The White House celebrated Mike Pompeo's confirmation as secretary of state by sharing a photo of him shaking hands with North Korean leader Kim Jong Un during a secret meeting on Easter weekend.

The Senate confirmed Pompeo via a 57-42 vote Thursday afternoon. He had been serving as CIA director under President Donald Trump and traveled to North Korea about four weeks ago to talk with Kim as the White House prepares for an historic summit between Trump and the reclusive leader regarding his country's nuclear weapons program.

White House press secretary Sarah Sanders shared two images on Twitter from the encounter between Pompeo and Kim that took place in Pyongyang, North Korea's capital.

"Great to have Secretary Pompeo confirmed," Sanders wrote. "He will do an excellent job helping @POTUS lead our efforts to denuclearize the Korean Peninsula."

Pompeo is the highest-ranking U.S. official to visit North Korea since 2000, when then-Secretary of State Madeleine Albright met with Kim Jong Il.

Pompeo's confirmation occurred just hours ahead of an historic peace summit between Kim and South Korean President Moon Jae-in. The two leaders will meet Friday on the South Korean side of the DMZ that separates their two countries, which will be late Thursday night in the U.S.

No North Korean leader since the end of the 1950-53 Korean War has stepped foot onto South Korean soil.

The meeting will be a crucial step in the run-up to Trump's sit down with Kim, which could take place in May or June.

Pompeo is "the perfect person to come in at this time and lead those efforts" on North Korea, Senate Foreign Relations Committee Chairman Bob Corker, R-Tenn., said on the Senate floor moments before Pompeo was confirmed.

Pompeo's confirmation vote was one of the closest in recent history. Every past nominee for the job since at least the Carter administration has received 85 or more yes votes in the Senate, with the exception of Trump's first Secretary of State Rex Tillerson, who got 56.

Pompeo was sworn into office a short time after the votes were tallied and his confirmation was made official in the Senate chamber. The former Republican member of the House from Kansas was slated to travel to Brussels for a meeting of NATO foreign ministers later Thursday, his first foreign trip as America's top diplomat.

Information from Bloomberg and the Associated Press was used in this report.