Two Scottish Fire and Rescue Service crews from Annan and a specialist Environmental Protection Unit from Hamilton were called to the scene.
The area surrounding the pool, situated next to Annan Academy, was cordoned off and members of the public arriving for subsequent swimming sessions were turned away by police and council staff.
Firefighters using breathing apparatus entered the building, housing the four-lane pool, after tests had revealed high levels of carbon dioxide.
Around 25 children from Lockerbie and Hottsbridge School and three teachers were half-way through a 45-minute swimming session when the drama unfolded.
Mother -of-three Fiona Reid, of Waterbeck, said: “I was sat poolside watching my two daughters have their lessons when the alarm started going off right behind me.
“We were all suddenly evacuated and told there was a leak.
“The pool staff were very efficient and there was no danger to our children at any time, but it was quite dramatic.”
Dumfriesshire MP David Mundell was holding his final surgery of the Parliamentary session in the community centre next door.
Mr Mundell was briefed on the situation but was able to continue with a series of meetings with constituents.
He said: “We would have gone ahead with the surgery outside if necessary but were able to continue.
“Everybody was calm and the safety systems at the pool seemed to work appropriately and the staff and emergency services responded in a very professional manner.”
Mr Mundell added that he was relieved that no-one appeared to have come to any harm as a result of the incident.
Dumfries and Galloway Council, which operates the facility, said the pool remained closed until 10.30 am on Saturday.
A spokesman said: “The pool was evacuated after the Co2 alarm went off on Friday evening.
“All procedures were followed correctly and nobody was injured during the evacuation.
“An engineer was on-site on Saturday morning and diagnosed that there was a problem with the tank valves.”