"How many of you guys are 18 in here?" she asked an estimated 13,000 people at Doolittle Park. "This is your first time, right?"
In between a set that included "Let's Stay Together," "Part of Me," "Teenage Dream," "Wide Awake" and "Firework," Perry told fans to vote early if they can.
"You know I got my poll outfit sorted. Because when I go to the polls in California it's gonna be on point," she predicted. "It's gonna be red, white and blue. For you know who. So you better do it. If not, I'm gonna come and get you."
Later, Obama was all smiles when thanking the pop superstar, who was recently named Billboard's Woman of the Year. He also thanked Perry's Grandmother, who gave the President a kiss on the cheek.