Iowa Gov. Terry Branstad is now, officially, Ambassador Terry Branstad.

On his 8,169th day in office, the longest-serving governor in American history formally resigned the office and was sworn in as the U.S. Ambassador to China.

Branstad submitted his resignation before a small crowd of family, friends and staffers before immediately taking the oath of office, formalizing a long-awaited transition that has been in the works for nearly six months.

"There’s no better job in the world than being governor of the state that you love," Branstad said just before signing his letter of resignation. "But sometimes we’re called to serve in ways that we never imagined. And now, I’m pleased to present my letter of resignation as I prepare for this exciting new adventure as the United States Ambassador to the People's Republic of China.”

Branstad, 70, was administered the oath of office by 8th Circuit Court Judge Steven Colloton, the highest-ranking federal judge in Iowa, just two days after he was confirmed by the U.S. Senate on an 82-13 vote.

MORE:

OBRADOVICH: Branstad was a 'political freak of nature'

Kim Reynolds becomes Iowa's first female governor

The ceremony, which was held in Branstad's formal office and live-streamed to a larger crowd in the Capitol's rotunda, was attended by top legislative leaders and state officials. Branstad's family, including his five oldest grandchildren, filled the front row while Department of Management Director David Roederer roamed the room manning a handheld video camera.

Branstad spoke from a lectern perched atop the desk he uses for formal bill signings and proclamations. Displayed behind him was a black and white signed photograph of Chinese diplomats on a visit to Iowa.

Those decades-old ties to China have helped propel Branstad into his new role as he hopes to leverage a longstanding friendship with current Chinese President Xi Jinping into better relations with one of the United States' biggest geopolitical rivals.

And although Branstad has previously discussed the challenges that await him in his new role, he took the opportunity Wednesday to look back at his career and reflect on his 22-year tenure as Iowa governor.

"We have worked tirelessly to deliver more jobs, higher incomes, better schools and a smaller, smarter government for the people of Iowa," he said. "We have worked together to improve our business climate, cut taxes, improve career prospects for our teachers, reduce the cost of health care, protect the unborn and safeguard our most dearly held freedoms.”

His administrations have led Iowa through the Farm Crisis of the 1980s, the prosperity of the 1990s and the post-Great Recession economic recovery of the past six years. In 2017, he oversaw a legislative session that brought "historic" change to Iowa as Republican majorities ushered in abortion restrictions, gun rights enhancements, collective bargaining reform and a host of other business-friendly laws.

"The future of our state is on a bright path thanks in part to the hard work and dedication of Terry Branstad," House Speaker Linda Upmeyer, R-Clear Lake, said in a statement. "The people of Iowa are thankful for all that he has done as we look forward to his next endeavor working for all Americans."

In China, Branstad will take on what he has called the "opportunity of a lifetime" as President Donald Trump’s top emissary to the nation's leading geopolitical rival.

During his confirmation hearing, members of the U.S. Senate Foreign Relations Committee quizzed him on issues ranging from intellectual property theft to human rights violations and nuclear threats stemming from North Korea.

"I see this as probably the biggest challenge that I’ve ever had in my entire life," Branstad said during that hearing. "And I want to do anything and everything that I can to try to find an acceptable solution for the benefit of the entire human race.”

Branstad is succeeded in Iowa by his lieutenant governor, Kim Reynolds, who was sworn in after Branstad's resignation.

"No one has been better prepared to become governor than Kim Reynolds," Branstad said as Reynolds looked on from the front row, smiling. "I am thankful for the friendships we have made throughout the 99 counties of Iowa — friendships that we will always cherish. And I’m grateful for the prayers from Iowans who have encouraged me along the way."

Secretary of State Paul Pate officially accepted Branstad's resignation at 10:14 a.m.

“It has been a great honor to serve with Gov. Branstad for many years," Pate said in a statement. "He is one of the most dedicated public servants in U.S. history and one of the most hard-working individuals I have ever known. I am humbled to accept his resignation and pleased to officially notify Kim Reynolds of the vacancy and her subsequent ascendancy to the position of Governor and all the powers of the chief executive of the state of Iowa."