President Obama is in Cambodia on the final leg of his three-country Southeast Asia tour. The trip marks the first time a U.S. president has visited the country.
The president also visited Myanmar, also known as Burma -- the first serving president to do so.
Myanmar had been under military rule for half a century until last year when a civilian government took office. Obama said his trip to Myanmar was meant to show America's support for the country's transition.
He said ties between the United States and Myanmar will grow stronger if Myanmar's moves toward democracy continue.
"You are the ones who are going to have to seize freedom because a true revolution of the spirit begins in each of our hearts," the president told a crowd at Yangon University. "It requires the kind of courage that so many of your leaders have already displayed."
Longtime opposition leader Aung San Suu Kyi agreed.
"The most difficult time in any transition is when we think that success is in sight," she said after meeting with the president. "Then we have to be very careful that we're not lured by the mirage of success."
Meanwhile, dozens of political prisoners were freed as a result of Obama's visit to Myanmar, including several human rights activists.