Six weeks after being named Foxboro’s next police chief, Michael Grace of Lewis Road was sworn in at the town public safety building Tuesday afternoon before a standing-room-only crowd of friends, family and well-wishers who offered heartfelt congratulations.

Grace was escorted into the packed conference room by an honorary bagpipe quartet and accompanied by a phalanx of uniformed Foxboro police and reserve officers on hand for the brief ceremony.

Town Clerk Robert Cutler administered the oath of office, after which Grace’s wife, Kirsten, pinned on his chief’s badge for the first time.

“Thank you so much for this pinning ceremony,” Grace exclaimed. “It means so much to me.”

In addition to Grace’s wife and three children, his parents, John and Elizabeth, also attended the ceremony.

Serving as master of ceremonies, Town Manager William Keegan said that Grace had learned lessons from both of his predecessors — retired chief Edward O’Leary and outgoing chief William Baker.

Keegan noted that law enforcement is a very different career, with more and greater challenges, in 2019 than it was 15-20 years ago.

“It is my judgment that Mike Grace is up to meeting those challenges,” he said. “I wish him great success and a safe career.”

Keegan also recognized state Sen. Paul Feeney and state Rep. Jay Barrows, both of whom presented legislative citations.

Characterizing the ceremony as “an incredible occasion, Feeney said Grace was well-suited to lead a force comprised of exceptional individuals.

“I know you’re a great cop and you’ll make a great chief,” Feeney said.

Noting the packed conference room, Barrows suggested that Grace’s swearing-in was “the hottest ticket in town” — adding that in the same time the New England Patriots have won six Super Bowl championships Foxboro has had just three police chiefs.

Taking the podium himself, Grace thanked those present while pledging to protect the community and bringing his “very best” to the job each and every day.

“I can tell you from the bottom of my heart that I love this job,” he said.

Grace also characterized Foxboro as “the best small police force” in the country, and voiced appreciation for the dedication of his fellow officers.

“They do it every day with pride and passion,” he said.

Grace also acknowledged the positive influence of chiefs O’Leary and Baker, while thanking his wife and three children for understanding the many times his job conflicted with family matters.

“I thank you for your support,” he said. “I know it hasn’t always been easy.”

Grace has signed a three-year contract with the town and will receive a $172,000 salary in his first year, along with $24,000 paid by Gillette Stadium for work there. The contract includes a 2.5 percent increase each year, which hinges on his annual performance reviews.

A 1989 Foxboro High School graduate, Grace had been one of two internal candidates vying for the opportunity to replace outgoing chief William Baker, who in April announced that he would be retiring effective Oct. 7.

Grace was chosen over Lt. Richard Noonan, the department’s patrol division commander, who also was a finalist for the chief’s position — and who was present to witness his friend’s swearing in on Tuesday.

Hired as a local patrolman in 1999, Grace previously had worked as a corrections officer at MCI-Concord and received his master’s degree in criminal justice from Western New England College in 2003.

Promoted to sergeant in 2005 and lieutenant in 2017, he had been in charge of the administrative division — which includes the department’s communications center, record management system and detective unit.

A reception following the ceremony was held at Lakeview Pavilion.