Perry, looking resplendent in a latex dress decorated with a ballot paper, warmed up the crowd as the President traveled from Los Angeles to Las Vegas for the free gathering, which drew more about 13,000 people, The Hollywood Reporter said.
Obama told the crowd that he was pulling an all-nighter, adding that if he wasn't going to get any sleep, he "might as well be in Vegas."
The singer, who turned 28 today, performed "Let's Stay Together," "Part of Me," "Teenage Dream," "Wide Awake" and "Firework."
Perry's 91-year-old grandmother was there and gave the president a kiss on the cheek, leaving a lipstick mark on his face. He joked that he had to wipe it off before First Lady Michelle Obama saw it.
"I've got to know Katy and she's a wonderful young lady. And I can tell that part of it is because of her outstanding grandma Anne, a 50-year resident of Nevada," said Obama.