WORCESTER — President Obama saluted graduates of Worcester Technical High School Wednesday, praising their school as a model for maintaining American competitiveness in a global economy.
“I want the nation to learn from Worcester Tech,” he told the school’s class of 2014 at their commencement at the DCU Center.
The president’s remarks underscored a growing national interest in career and technical education, once known as vocational education.
Policymakers from Washington to Beacon Hill are concerned that the country is not doing enough to train students for jobs in high-tech manufacturing and other technical fields. And soaring college costs are undermining faith in traditional higher education as a path to prosperity.
“Together, you’re an example of what’s possible,” Obama said. “When we stop just talking about giving young people opportunity, when we don’t just give lip service to helping you compete in the global economy, we actually start doing it.”
The president’s speech came just hours after Senate Republicans blocked legislation, authored by Senator Elizabeth Warren, designed to curb student loan debt.
“Today that idea was defeated by Republicans in Congress,” he said, prompting boos.
“Don’t boo,” he said. “Just remember to vote.”
Republicans dismissed the Warren bill, which would tax the rich so college graduates can refinance their loans, as an election-year gimmick with little chance of passage.
But in the run-up to the Senate vote, Obama and Warren cast the legislation as a question of values, arguing that Republicans were putting billionaires before students.
Worcester Tech was struggling when principal Sheila Harrity took over in 2006. But it is now considered a national model.
Last year, the US Department of Education named it a National Blue Ribbon School. And last month Harrity, a National High School Principal of the Year, was recognized in a White House ceremony.
Eighty-two percent of Worcester Tech’s 301 graduates plan to attend a two- or four-year college, she said in her opening remarks Wednesday.
Harrity learned in March that Obama would be speaking at the graduation. Her mother Beverly was in the midst of a six-hour heart valve operation in Boston, and Harrity was out for a short, stress-relieving walk, checking her phone periodically.
“I looked at my e-mail and it said, ‘Subject: Question from the White House,’ ” she said, in an interview Wednesday morning.
Harrity said she called the White House to inquire and was overwhelmed by the news. When a staff member asked when the graduation would take place, an overjoyed Harrity could not read her calendar through the tears.
Harrity’s mother was at the ceremony Wednesday.
The commencement amounted to a civic celebration for a struggling city.
The president stepped off Air Force One and into the spitting rain at Worcester Regional Airport about 3:30 pm, greeted by Governor Deval Patrick, US Representative James P. McGovern, and Mayor Joseph Petty of Worcester.
Worcester Regional Transit Authority buses flashed messages welcoming the president, and residents lined the route to the DCU Center downtown.
Hours before his arrival, the line to get into the ceremony stretched around the corner: thousands of people dressed in bowties and neckties, T-shirts, and dresses.
“It’s a great day for Worcester,” said Stephanie Chaparian, 34, a product designer whose father teaches science at Worcester Tech.
Her mother Karen, a lifelong resident of Worcester, said the struggling city is often seen as the stepchild of Massachusetts. It was good, she said, to have a little glamour in town.
The last sitting president to visit Worcester was President Clinton in 1999. But there were others before him.
“You should know that you are not the first president to grace these hills,” Petty told Obama in introductory remarks, noting that John Adams was a Worcester schoolteacher and Theodore Roosevelt became the first president to speak at a Catholic college when he took the stage at Holy Cross in 1905.
Obama told the graduates that he did not remember his own graduation speaker. “I’m sure I was thinking about the party after graduation,” he joked. “I don’t remember the party, either. I’m just telling the truth here.”
He told the graduates that they had only made it this far with the help of others and that they must be willing to give back.
He added that he sometimes worries that a generation raised in war and recession is growing up in a cynical time and with a tall task, competing with the whole world for good jobs.
“But when I meet young people like you, I am absolutely certain we are not just going to outcompete the rest of the world, we are going to win,” he said.
Obama congratulated all of the graduates with handshakes, hugs, and back slaps, before making his way to a Weston fund-raiser benefitting the Democratic Senatorial Campaign Committee.
In Weston, Obama told about 30 supporters that they are crucial to helping Democrats regain the majority in the midterm election.
The president spoke after dinner at the posh home of Joanne and Paul Egerman, huge Democratic fund-raisers. Tickets to the event cost $32,400 each.
Obama also said he does not see the defeat of House Republican leader Eric Cantor on Tuesday as scuttling immigration legislation.
‘‘It’s interesting to listen to the pundits and the analysts, and some of the conventional wisdom talks about how the politics of immigration reform seem impossible,’’ Obama told the donors. ‘‘I fundamentally reject that, and I will tell the speaker of the House he needs to reject it.
“At a certain point, issues are important enough to fight for. My argument about [Tuesday’s] election is not that there was too little politics, but that there was too little conviction about what is right. We need to get immigration reform done.”Meghan Irons of the Globe staff contributed to this report. David Scharfenberg can be reached at david.scharfenberg