Yagura was the former Jinchuriki for the Three-tailed Giant Turtle and the Fourth Mizukage.
During his reign as the Mizukage, Yagura was controlled by Tobi, who shaped the village as he saw fit.
In the anime, the Giant Turtle was captured outside of its host and how it came to be this way is unknown.
Yagura was resurrected along with the other 6 deceased Jinchuriki by Kabuto in the Great Ninja World War to fight alongside the Akatsuki. he was given an Eternal Mangekou Sharingan and a Rinnegan by Madara.