A New York man pleaded guilty Thursday to making death threats against two senators for supporting Justice Brett M. Kavanaugh’s confirmation last year.

Ronald DeRisi faces up to 10 years in prison for the threats and agreed to give up two rifles as part of his plea.

Authorities say they recovered more than 10 threatening voicemail messages DeRisi left on the unnamed senators’ office lines in September and October.

In one call in the run-up to hearings and a vote on Justice Kavanaugh, DeRisi suggested he was going to shoot one of the senators over the vote: “It’s a nine millimeter. Side of your [expletive] skull, you scumbag [expletive],” the man said in one message, concluding, “Yeah, Kavanaugh — I don’t think so.”

Another call threatened: “I’m gonna get you.”

Similar threats were left after Justice Kavanaugh was approved by the Senate.

“This defendant threatened to assault and murder two sitting United States senators in an effort to intimidate them and interfere with their performance of official duties,” Richard P. Donoghue, U.S. attorney for the eastern district of New York, said in announcing the guilty plea.

Police who tracked down DeRisi said they found him with “live ammunition.”

DeRisi had undergone a court-ordered psychological evaluation, but it was not clear from the court records what the outcome was.

Police said they were able to trace the calls to Mr. DeRisi because he used his own cellphone to leave the messages for both senators.

They also matched his voice to threatening messages left years ago for someone in New York in an unrelated incident. Mr. DeRisi pleaded guilty to one count of aggravated harassment in that case.

The Kavanaugh confirmation brought out the worst in many Americans, with angry protesters mobbing the Senate, and some lawmakers encouraging conflict with Republicans who backed the justice.

A staffer for a House Democrat has also been charged with breaking into another congressional office and leaking the home addresses and personal telephone numbers of several Republican senators during the Kavanagh confirmation process.