Jon David Levy of Portland, Maine’s newest federal judge, swore an oath of office and donned black robes during a formal induction ceremony Friday in U.S. District Court.

The ceremony in Portland was attended by more than 150 people, including dozens of judges and some of the state’s most prominent lawyers.

Levy, nominated by President Obama last September and confirmed to the position by a U.S. Senate vote in April, became only the 18th federal district judge in the nation’s history to be appointed to serve in the District of Maine.

Levy stood before Chief Judge John A. Woodcock Jr. with his right hand raised as he repeated the oath, facing an array of judges that included several members of the 1st Circuit Court of Appeals from Boston and every active and semiretired federal judge in the state.

His wife, Miriam Levy, and daughters, Anna Prager and Rachel Levy, afterward carried the robe and draped it over his shoulders to a loud round of applause from the crowd gathered in the building’s most stately courtroom at the top of a sweeping flight of marble steps.

With so many state and federal judges and elected officials in attendance, including U.S. Sen. Angus King, security was noticeably increased.

“An event like this is almost as complicated as a wedding,” Woodcock said at the start of the ceremony, drawing a laugh from the crowd as he stood at the bench.

Federal agents from the Department of Homeland Security had swept the building on Thursday as a security precaution, and a row of marked SUVs lined the street throughout the ceremony. Armed uniformed agents, including one leading a police dog, patrolled outside of building. Uniformed court security officers and plainclothes members of the U.S. Marshals Service made additional checks inside.

King was one of the first speakers to address the crowd, explaining how his path first crossed with Levy’s when King was Maine’s governor and nominated Levy to the Maine District Court in 1995 and then the Maine Supreme Judicial Court in 2002.

Earlier this year, King and U.S. Sen. Susan Collins, a Republican, championed Levy’s nomination before the full Senate.

“I am just happy that someone of Jon Levy’s quality, character, integrity and humanity is willing to take on this responsibility,” King said.

Portland attorney Peter DeTroy, who served as chairman of the search committee that recommended Levy as a potential nominee for Obama to consider, also spoke at the ceremony and called Levy “one of Maine’s best and brightest.”

Levy replaces U.S. District Judge George Singal and joins Woodcock and Nancy Torresen as federal judges in Maine. Singal and D. Brock Hornby have assumed “senior status” and will occasionally hear cases.