President Obama had some unexpected trouble at the White House on Wednesday: He couldn't get into the Oval Office.

After returning from a five-day trip to Latin America, President Obama returned to the White House to find that some of the doors to the Oval Office were locked tight.

Staff at the White House appeared not to have known that the the president had returned early from his trip and hadn't unlocked the doors, according to an ABC News affiliate in Washington.

Obama handled the setback coolly, however, and simply tried another pair of doors, which were unlocked. 

In 2009, while responding to a question about the controversial arrest of Harvard Professor Henry Louis Gates Jr., President Obama joked about getting locked out of the White House. Gates was arrested after he forgot the keys to his home and tried to break in. 

"I mean, if I was trying to jigger into — well, I guess this is my house now so — it probably wouldn't happen. But let's say my old house in Chicago. Here [at the White House], I'd get shot," Obama joked.

Watch the video below:

This post was updated at 1:18 p.m.