In the US, the perpetrator who hit the husband of US House of Representatives Speaker Nancy Pelosi on the head with a hammer is to be charged with attempted murder.

The San Francisco Attorney's Office said formal charges will be brought against the 42-year-old on Monday.

According to police records, the man was arrested on suspicion of attempted murder, assault with a deadly weapon, elder abuse, assault, burglary and other offences.

Meanwhile, the condition of Pelosi's husband, Paul Pelosi, is said to have improved, the House Speaker said in a statement.

"Our children, our grandchildren and I are heartbroken and traumatized by the life-threatening attack on her husband," she said on Twitter.

"We are grateful for the quick response from law enforcement and emergency services and the life-saving medical care he is receiving."

The perpetrator broke into the couple's home on Friday.

He is said to have shouted "Where's Nancy?" and hit the 82-year-old in the head with a hammer, injuring his arm and hands. Nancy Pelosi was in Washington at the time of the attack but flew to San Francisco after the attack to be with her husband.

“We know that this was no accidental act”

The investigators are being assisted by FBI agents, San Francisco Police Chief William Scott said at a Friday night news conference.

It is not yet known what triggered the break-in into the house.

"We know this wasn't an accidental act," Scott said.

The 42-year-old perpetrator entered the Pelosis' house through a back door.

Aerial photos showed shattered glass at the back of the house.

US President Joe Biden told reporters in Wilmington, Delaware on Saturday that Pelosi's husband is doing better and that the attack appeared to have been aimed at Nancy.

The incident came just about a week and a half before the Nov. 8 midterm elections, stoking fears of political violence ahead of the vote.

A good third of the Senate and the entire House of Representatives will be re-elected.

The Democrats of US President Joe Biden and Nancy Pelosi currently have the majority in the House of Representatives, but they could lose them in the elections and Pelosi with it his top office.

In terms of protocol, she is number three in the USA after Biden and Vice President Kamala Harris.

Pelosi is frequently criticized by Republicans and is often the target of verbal attacks.