Police arrested a gunman outside the home of Supreme Court Justice Brett Kavanaugh, who is now facing charges of attempted homicide.

"The man was armed and had made threats against Judge Kavanaugh," a spokeswoman for the Supreme Court said in Washington on Wednesday.

The responsible public prosecutor's office in the neighboring state of Maryland announced that the 26-year-old had carried, among other things, a pistol with two magazines, additional ammunition, pepper spray, a hammer and cable ties.

He is charged with attempting to kill a US judge, which could mean up to 20 years in prison if convicted, prosecutors said.

Nicholas R., who is from California, took a taxi to Kavanaugh's house in the early hours of Wednesday morning.

When he saw two police officers there, he went in the other direction.

A short time later, the man called the police and said he was carrying a gun and was considering suicide.

Police officers arrested him a little later, it was said.

Excited about massacre in Uvalde

After the arrest, R. said he was upset about the Supreme Court's role in the abortion rights debate and the recent school massacre in Texas.

19 children and two teachers were shot dead.

Last month, the Supreme Court announced its draft ruling that the country's relatively liberal abortion law could soon be history.

The Supreme Court could soon overturn its 1973 landmark ruling on abortion.

According to a report by Politico magazine, the draft was supported by Kavanaugh, among others.

The conservative judge was nominated by then US President Donald Trump in 2018.

The report sparked an outcry among abortion advocates and led to protests in various US cities.

US Attorney General Merrick Garland increased protections for Supreme Court justices last month.

Referring to the arrest, Garland said threats and actual violence against Supreme Court justices "go to the heart of our democracy" and will not be tolerated.