BALTIMORE – President Obama tried Friday to leave behind the political battles that have overshadowed his second-term agenda, saying lawmakers should work on creating more middle-class jobs in the slowly growing economy. “Our work is not done, and our focus cannot drift,” he said.

Obama’s jobs tour took him to Baltimore after riding through one eruption after another during the past few weeks, from new questions over his administration’s handling of last year’s deadly attack in Benghazi, Libya, to revelations of political targeting at the Internal Revenue Service and a secret probe of The Associated Press and its confidential sources.

“Others may get distracted by chasing every fleeting issue that passes by, but the middle class will always be my No. 1 focus,” Obama said at Ellicott Dredges, maker of equipment for digging and pumping projects including mining.

The company, which helped build equipment that dug the Panama Canal, has been adding jobs through international sales in spite of a sluggish economy. Obama took a tour of the plant and got a close-up look at the assembly process, including excavation equipment being made for a customer in Bangladesh.

In his speech to several hundred workers and guests, Obama cited growth in the economy, a drop in unemployment nationwide and improvements in the housing and auto industries. But he said Washington still needs to do more to build a “rising, thriving middle class.”

“We’re now poised for progress, but our work is not done and our focus cannot drift,” he said. “We’ve got to stay focused on our economy and putting people back to work and raising wages and bringing manufacturing back to the United States of America.”

“That has to be what we’re thinking about every single day,” he added.

But the partisan fighting followed Obama even as he traveled north of the Beltway, with Republicans criticizing the trip as stagecraft.

Rep. Andy Harris, Maryland’s only Republican congressman, said Obama should have stayed in Washington to focus on job-creation efforts such as the Keystone XL pipeline, which would carry oil from western Canada to the Texas Gulf Coast and create jobs.

“That would boost jobs at Ellicott Dredges, but other than that, it’s just going to be another photo op on a campaign-style tour when the president should be in Washington tending to the nation’s business and to address the huge scandals that are popping up on a daily basis in Washington,” Harris said in a conference call with other Maryland Republicans.

The administration has not yet taken a position on the Keystone project, which is opposed by environmentalists but supported by the president of Ellicott Dredges, Peter Bowe, in testimony before Congress just a day earlier. Bowe said in an interview that he didn’t discuss it with the president.

“I’m not afraid of talking about it, but it didn’t come up,” Bowe said. Instead, he said, he told Obama about how the federal government is helping its export business.

Obama touted his effort to more quickly create construction jobs and repair roads, bridges and railways. He cited as an example the recently approved replacement of the aging Tappan Zee Bridge across the Hudson River in the suburbs just north of New York City. The White House said such large projects can take as many as four years to complete the permitting process, but multiple federal and state agencies coordinated simultaneous reviews to cut the time to a year and a half.

Obama also highlighted his proposal to provide preschool for all low-income families by visiting an early childhood program at Baltimore’s Moravia Park Elementary School. He sat at a table in the library with 4- and 5-year-olds learning to draw and write about their favorite zoo animals.

“I’ve got to say, my tiger was not very good,” Obama joked later. “The kids were unimpressed.”

And he visited the Center for Urban Families, a nonprofit that promotes responsible fatherhood and provides job training to parents. One dad, Marcus Dixon, talked about how the center helped him after he got out of jail so he can help provide for his sons, ages 2 and 10. “It’s restored my dignity,” Dixon said of the program.

Obama told Dixon he is setting a powerful example for his sons and noted that he himself grew up without his father.

“I always tell people that, as great and heroic a job as moms do, particularly for boys, that’s a hard situation,” Obama said.