Former President Jimmy Carter has been released from a hospital in Canada after being treated for dehydration, a spokesperson for Carter confirmed Friday.

The Carter Center said the former president, who was in Winnipeg with Habitat for Humanity, was released from St. Boniface General Hospital Friday morning.

A witness told CBC they witnessed Carter collapse while he was working with Habitat for Humanity, building a home in Winnipeg.

An ambulance arrived on scene shortly after firefighters and paramedics scrambled to attend to the 92-year-old former president. Carter was taken to the hospital as a precaution, according to a spokesperson for Habitat for Humanity.

Carter and wife Rosalynn have been longtime supporters of Habitat for Humanity and have been working with the organization to build houses, and visited Alberta earlier this month. The two have been taking part in the organization's Humanity "blitz," which has a goal of building 150 new homes between July 9-14 to commemorate the 150th anniversary of the confederation of Canada.

Shortly after his release, Carter attended a morning prayer and devotional service, kicking off the last day of the annual "Jimmy and Rosalynn Carter Work Project in Canada."