Vice-President Kamala Harris became the first woman to – briefly – be given presidential powers while President Joe Biden underwent a regular health check.
President Biden transferred power to Ms Harris for about 85 minutes, while he was placed under anaesthesia for a routine colonoscopy on Friday morning.
The medical examination was Mr Biden’s first as president and came on the eve of his 79th birthday.
Ms Harris temporarily took control of the US military and nuclear weapons.
She carried out her duties from her office in the West Wing of the White House, officials said.
Ms Harris, 57, is the first woman – and the first black and South Asian American – to be elected US vice-president.
White House Press Secretary Jen Psaki said the temporary transfer of powers in such circumstances was not unprecedented, and that it was part of the process set out in the US constitution.
“As was the case when President George W Bush had the same procedure in 2002 and 2007,” she said in a statement.
Later on Friday, Ms Psaki tweeted that Mr Biden was in “good spirits” at the Walter Reed Medical Center in Maryland, and had resumed his duties as of 11:35 local time.
“He will remain at Walter Reed as he completes the rest of his routine physical,” she added.
Mr Biden, the oldest US president to take office, had his last full medical examination in December 2019.
At the time, his doctor released a medical report describing him as “healthy, vigorous” and “fit to successfully execute the duties of the presidency”.
The president’s latest health check came on the day that the US House of Representatives approved his landmark $1.9tn (£1.4tn) Build Back Better Act.
The sweeping social spending and climate package is considered a key pillar of Mr Biden’s agenda.