In this file photo taken on April 23, 2019, US Speaker of the House of Representatives Nancy Pelosi and husband Paul Pelosi arrive for the Time 100 Gala at Lincoln Center in New York. Image Credit: AFP

San Francisco: A hammer-wielding man attacked US House Speaker Nancy Pelosi's husband during a break-in at the couple's San Francisco home early on Friday, authorities said, in an assault that raised fears about political violence ahead of the Nov. 8 midterm elections.

Her husband, Paul Pelosi, 82, was taken to hospital and is expected to make a full recovery, Pelosi's office said.

The man arrested at the scene, David Depape, 42, will be charged with attempted homicide, assault with a deadly weapon and several other criminal charges, San Francisco Police Chief William Scott said.

The Democratic speaker of the US House of Representatives, who is second in the succession line of the US presidency, was in Washington with her protective detail at the time of the assault, according to the Capitol Police.

Authorities said they were still investigating a motive for the attack in the early hours of the morning.

CNN, citing a source, reported that the assailant shouted "Where is Nancy?" before the attack and told police he was "waiting for Nancy" when they arrived at the scene.

Recent posts on several internet sites by a user named "daviddepape" include mention of anti-Semitic conspiracy theories, criticism of women, "satanic paedophilia," censorship by tech companies, and other far-right themes. Older messages promote quartz crystals and hemp bracelets. Reuters could not confirm that the posts were created by the suspect.

It was unclear how the intruder got into the three-story red brick townhouse in the affluent Pacific Heights neighborhood.

Aerial photos showed shattered glass on a door at the rear of the house. Streets around the residence were closed off on Friday morning.

Dmage to the home of US House Speaker Nancy Pelosi after her husband Paul Pelosi was violently assaulted during a break-in at their house in San Francisco, California. Image Credit: Reuters

The assault occurred less than two weeks before midterm elections in which control of the House and US Senate is at stake.

Scott said police were dispatched to the house at 2.27am Pacific time (0927 GMT), where they encountered Depape and Paul Pelosi struggling over a hammer, before Depape pulled the hammer away and attacked Pelosi.

Police disarmed and arrested Depape and took both men to a hospital for treatment, Scott said.

He declined to answer questions and said police would provide more details later.

Several media outlets reported that Paul Pelosi was undergoing brain surgery, while the Associated Press reported that he was being treated for bruising and severe swelling.

Reuters was unable to confirm those accounts.

President Joe Biden called Pelosi to express his support, according to White House spokesperson Karine Jean-Pierre.

House Republican Leader Kevin McCarthy also said he reached out to Pelosi, while Senate Republican Leader Mitch McConnell said he was "horrified and disgusted" by the attack.

FBI agents work outside the home of U.S. House Speaker Nancy Pelosi. Image Credit: Reuters

The Capitol Police, responsible for protecting Congress, said it was working with the FBI and San Francisco police on the investigation.

New York City police warned on Thursday that extremists could target politicians, political events and polling sites ahead of the midterm elections.

Republicans have been campaigning on concerns about violent crime, as well as inflation and other quality-of-life issues.

San Francisco's crime rate in 2021 was 1.5 times the national average, according to several crime-tracking websites.

As a Democratic leader in Washington and a longtime representative from one of America's most liberal cities, Pelosi, 82, is a frequent target of Republican criticism and is often featured in attack ads.

Her office was ransacked during the Jan. 6, 2021, attack on the US Capitol by supporters of Republican then-President Donald Trump, some of whom hunted for her during the assault.

In January 2021, her home was vandalized with graffiti saying ""Cancel rent" and "We want everything" painted on the house and a pig's head left in front of the garage, according to media reports.

McConnell's home also was vandalized around that time.

In a politically polarized climate, threats against Republican and Democratic lawmakers have been on the rise.

Capitol Police said they investigated 9,625 incidents in 2021, nearly a threefold increase from 2017.

A gunman angered by Trump shot and wounded five Republican members of Congress at a baseball practice in 2017, and Democrat Gabby Giffords was shot in the head at a public appearance in 2011.

Paul Pelosi, who owns a San Francisco-based real estate and venture capital firm, was convicted of a misdemeanor charge of driving under the influence of alcohol after becoming involved in an auto accident in May. He was sentenced to five days in jail in Napa County, California.