BOSTON – U.S. Sen. Edward Markey is vowing to fight against automatic federal spending cuts and keep critical grant money flowing into key research industries in the state as he settles into his new job on Capitol Hill.

Markey made his comments Thursday during a ceremonial swearing-in at Boston’s historic Faneuil Hall.

Several hundred supporters filled the hall to cheer Markey, who was making his first major speech since winning a June special election to fill the seat left vacant by John Kerry’s resignation from the Senate to become U.S. secretary of state.

Markey, a Democrat, said he was proud to represent Massachusetts and would seek consensus where he could without betraying the state’s core principles. He said one of his first fights will be trying to undo the federal spending cuts that he said are threatening jobs in sectors critical to the state’s economy such as defense, clean energy and medical research.

He said he hopes Republican lawmakers begin to take heed of what he called the “riptide of sequestration” as they spend time in their home districts.

“I think that the pain that is going to be inflicted on every community across the country is going to be reflected in the conversations that Republicans have as they return to their districts this summer,” Markey said. “I think it will begin to make a real difference.”

Markey, who served 37 years in the House, said that although he’s been in the Senate less than a month, he’s far from a novice.

He said he has a good relationship with most of his fellow senators, having served with 51 of them when they were members of the House and working with dozens more on various issues over the years.

Markey also said he’s enjoying going from the minority party in the House to the majority party in the Senate.

“Of all the things that are most invigorating about the process is … to have the Democrats being able to determine who testifies and what the issues are that are brought up,” he said.

Markey said his experience in the House is a good complement to what he called the “superstar” status of fellow Democratic Sen. Elizabeth Warren, who won last year’s Senate contest.

“I think our state is going to be well represented,” he said.

Markey also said he was comfortable with one of his first major policy decisions even though that meant staking out a position at odds with President Barack Obama on the question of student loans.

Markey had joined Warren in criticizing a Senate compromise on college loans, saying the deal didn’t go far enough to protect students from crushing debt and could mean higher rates as the economy improves. Obama backed the compromise.

Markey said he favored a plan that would have locked in lower rates.

Boston Mayor Thomas Menino introduced Markey and administered the ceremonial oath of office.

Markey was sworn in last month by Vice President Joe Biden during a brief ceremony in the Senate chamber in Washington.