NASA reached a milestone on Friday when two Americans, tasked with replacing a power controller, ventured out of the International Space Station: the astronauts, Christina Koch and Jessica Meir, became the first to take part in an all-female spacewalk.

The walk, which lasted seven hours and 17 minutes and included a brief call with President Trump, was not purposefully planned by the agency. As NASA explained it, one was bound to happen eventually because of the increasing number of female astronauts.

But news of the milestone attracted far greater interest than spacewalks normally do, and on Friday, American officials celebrated it as a historic achievement. They pointed to the agency’s ambitious goals to put the first woman and the next man on the moon, and then to forge a path to Mars.

Live video of the spacewalk showed two figures in bulky white gear — first Ms. Koch, then Dr. Meir — working outside of the space station, which glowed against the blackness of space. The women could be heard talking to controllers , and helmet cameras showed the view as they clambered along the outside of the space station.