Former U.S. President Jimmy Carter is out of the hospital after being treated for dehydration in Canada, a spokeswoman said Friday.

Representatives for Carter and Habitat for Humanity said on Thursday that the 92-year-old became dehydrated while volunteering at a home-building project in Winnipeg and was taken to the hospital for rehydration as a precaution.

Carter spokeswoman Deanna Congileo says he was discharged from St. Boniface General Hospital on Friday morning and then attended a devotional to begin the last day of a Habitat for Humanity home-building project.

"He and Mrs. Carter extend their appreciation for the many well-wishes he received worldwide," Congileo said in a statement.

Carter had joined Habitat as the organization builds 150 homes for people in need in Canada to celebrate the country's 150th anniversary.

The former president and his wife, Rosalynn, were in Edmonton, where Habitat is building 75 homes, from Monday to Wednesday before coming to Winnipeg, where the couple joined hundreds of volunteers working on 25 homes in the St. James community, said Rowena Sara, a spokeswoman for the organization.

Carter had been working for about 90 minutes Thursday morning when he went to sit down in a chair, the Winnipeg Free Press reported. He appeared to wobble, so Secret Service agents led him to his motorcade. He was treated by paramedics who took him away in an ambulance, without using lights or siren, the newspaper said.

The Carters are prominent backers of the Atlanta-based building charity. This week's project building houses in several Canadian communities is the 34th time the Carters have pitched in on Habitat projects, lending a hand and their name to promote the work.

Carter was diagnosed with melanoma that spread to his brain in 2015 but announced in March of the following year that he no longer needed treatment. Carter continued to volunteer for Habitat while being treated for cancer, working alongside volunteers at a home in Memphis, Tennessee, in November 2015.