A mysterious leak of coolant on the international space station compelled two astronauts to make an extraordinary, unplanned spacewalk Saturday in which they tried to find the source of ammonia snowflakes that have been streaming into space since Thursday. They didn’t spot any ammonia, but they did manage to pop in a new pump that may have solved the problem once and for all.

The 51 / 2-hour spacewalk was the 168th EVA (extravehicular activity) in the history of the space station, but it was the first of its kind: a repair job hastily choreographed after the astronauts discovered Thursday that a cooling system had sprung a leak. Thursday night, as the astronauts slept, the leak worsened, and NASA officials decided to throw together a spacewalk on the fly.

The loss of the ammonia coolant forced the shutdown of one of the eight power systems that provide electricity to the station. The station and the crew were never in peril — this was not an emergency in that sense. NASA could have punted and waited for a new crew to come aboard with a carefully crafted repair plan.

But an agency known for deliberate actions decided this time to order two astronauts to suit up. NASA wanted to spy the source of the leak before all the ammonia had bled away into space. Also, the station had two veteran spacewalkers on board, Tom Marshburn and Chris Cassidy, who had worked on that part of the station.

Saturday morning, the two astronauts emerged from the air lock and began snooping around for ammonia snowflakes. They saw none.

“So far, no smoking gun, an hour and a half into the spacewalk,” an announcer said on NASA TV, which streamed images of the astronauts patrolling a truss of the station and aiming their cameras at the innards of machinery packed with tubes and wires.

“All the pipes look shiny, clean. No crud,” Cassidy reported at one point.

Cassidy and Marshburn used a power tool to remove a boxlike pump apparatus believed to be a possible source of the leak. They then replaced it with a spare pump that the NASA engineers had thoughtfully put on the station long ago. That pump was then pressured up. Still, no ammonia leak appeared.

After stowing the old pump, the spacewalkers underwent a “bakeout” period, bathing in sunshine in an attempt to get rogue ammonia to sublimate from their spacesuits. The ammonia can be toxic inside the station, and NASA spared no effort in making sure the astronauts were ammonia-free before they rejoined their crew mates.

It’s unclear if the spacewalk and the installation of the new pump has put an end to the leak, NASA officials said in a late-day news conference. They said it would take weeks of monitoring to determine if the swapped-out pump was the source of the leak. They will also continue to operate the station without the shut-down power system. But the officials were clearly pleased that the impromptu spacewalk went off without a hitch.

“This was a momentous spacewalk,” a Mission Control official said when the astronauts were back in the air lock.

The leak never posed a threat to the station or to the astronauts, but NASA would like to get the power system back up and running, since it provides one-eighth of the electricity to the station.

“It’s really not a big deal to us overall. It shows the redundancy of the station, it shows how strong a research facility it is,” said William Gerstenmaier, NASA’s associate administrator for human spaceflight. But he added, “I think the next failure, or the failure after that, becomes a problem.”

The safety of the astronauts is the highest priority on a mission like this. The astronauts must be extremely careful not to touch anything sharp or do anything that might compromise their pressure suits.

“The reason they regularly check their gloves is for damage. Even though multi-layer, even a tiny leak requires immediate haste to airlock,” tweeted crew commander Chris Hadfield as he supervised the spacewalk from inside the station.

Saturday’s spacewalk gave Marshburn a chance to end his five months in space in style.

On Monday, he, Hadfield and crew mate Roman Romanenko will climb into the Soyuz spacecraft, undock from the station and return to Earth, landing in southern Kazakhstan. Three fresh astronauts will rocket to the station May 28 to join the three remaining on board.