President Obama insisted Friday that he is focused on improving the lives of middle-class Americans, despite being buffeted in Washington by a trio of controversies that have threatened to distract him from his second-term agenda.

Capping one of the most difficult weeks of his tenure, Obama left the Beltway for this city 40 miles north to try to change the subject from the problems of his administration and refocus attention on his efforts to create middle-class jobs. He toured an elementary school, manufacturing plant and community center.

“I know it can seem frustrating sometimes when it seems like Washington’s priorities aren’t the same as your priorities,” Obama told a crowd at the Ellicott Dredges facility. “Others may get distracted by chasing every fleeting issue that passes by. But the middle class will always be my number one focus, period. Your jobs, your families, your communities, that’s why I ran for president.”