SALT LAKE CITY — Lt. Gov. Spencer Cox gleefully measured the drapes in Gov. Gary Herbert's office and then sat behind his desk with his feet up, but the deputy governor was only in charge for a few hours on Friday.

The playful tweets were posted to the governor's account ahead of Herbert's successful surgery to remove kidney stones Friday evening.

Just got home from the hill and caught @SpencerJCox measuring for drapes in the governor's mansion. Seriously? You'll only be governor for an hour tomorrow! #utpol pic.twitter.com/2uFeAvBWoJ — Gov. Gary Herbert (@GovHerbert) January 26, 2018

The handoff lasted just over two hours before Herbert was out of surgery and no longer under anesthesia, as stipulated by the governor's proclamation detailing the transfer of power.

"The peaceful transfer of power has occurred. All is right with the world," Cox tweeted Friday about 7:30 p.m.

Herbert's office said in a statement the procedure went well Friday night and that "the prognosis is for a full and uneventful recovery."

Cox earlier tweeted that he was praying for the governor and that he took his short-term responsibility "very seriously," but it didn't take long for him to change his Twitter biography to "GOVERNOR" and start cracking jokes on social media.

Great news! The operation was a success and @GovHerbert is awake and coherent. The peaceful transfer of power has occurred. All is right with the world. #1hourGov pic.twitter.com/w3NTM9qAlt — Spencer Cox (@SpencerJCox) January 27, 2018

During his brief stint as Utah's chief executive, Cox wished his wife, Abby, a happy birthday, with a declaration saying she will always be "the first lady of my heart." He plugged his town of Fairview, playfully nominated Utah Jazz forward Joe Ingles as his own lieutenant governor and launched a campaign to #MakeUtahRectangularAgain by wresting its missing northeastern corner from Wyoming.

Herbert approved such silliness before going under, Cox said.

On Wednesday, Herbert delivered his annual State of the State address despite being diagnosed with two kidney stones on Tuesday by a specialist at LDS Hospital who saw him for unexplained abdominal pain.

A few minutes ago @GovHerbert entered the operating room. Even though this is a very low-risk procedure, any surgery carries risk. Please know I take the burden of this short transition very seriously. Praying for our Governor. #1hourGov pic.twitter.com/DCuagSQ23N — Spencer Cox (@SpencerJCox) January 27, 2018

His staff said he had no interest in postponing the speech.

Although the governor "has been experiencing pain, he remains in good spirits and has maintained a full schedule," his deputy chief of staff, Paul Edwards, said in a statement Wednesday.

On Thursday and Friday, Herbert continued to hold meetings, including with his cabinet, before leaving the Capitol Friday afternoon to prepare for his surgery.

Ok, I have one more critical declaration left. If I only get one shot at this...Abby is the best thing that ever happened to me & Utah is lucky to have her as 1st Lady, if only for an hour. Happy birthday my love! ❤️ #1hourGov pic.twitter.com/85MK6taX5p — Spencer Cox (@SpencerJCox) January 27, 2018

That being said...um...I’M THE GOVERNOR FOR 1 HOUR and we are going of have a little fun. If you don’t have a sense of humor, please press the mute button. (And yes, @GovHerbert is ok with this) — Spencer Cox (@SpencerJCox) January 27, 2018

But today is #HappyAustraliaDay, and there is one guy that is PERFECT for the job...I mean he’s *literally* number 2. As such, I’m nominating @Joeingles7 to serve as Lt. Governor. #1hourGov @utahjazz pic.twitter.com/ED0561DDAK — Spencer Cox (@SpencerJCox) January 27, 2018