Republican Martha McSally gives interviews to the local media on Wednesday, Dec. 17 at her Tucson campaign headquar

Mike Christy / Arizona Daily Staar

The election of former fighter pilot Martha McSally was the last race to be decided in midterm elections for the U.S. House.

Republican Martha McSally has finally and officially been declared the winner in a very, very close congressional race.

McSally won by 167 votes, a Superior Court judge announced Wednesday. She will be sworn into Congress on Jan. 6.

She learned about her victory through a text message, which was sent from her lawyer in the Phoenix courtroom to her campaign manager in Tucson.

McSally said she will name a transition team today and later build advisory teams, composed of local experts in subjects like health care, education, small business and border issues.

The original vote count was so close — less than one-tenth of 1 percent of votes cast — that a recount was required. The first tally after the Nov. 4 general election showed McSally winning by 161 votes.

McSally ousted Democratic incumbent Ron Barber, who served one full term and one partial term representing Congressional District 2 after his former boss, U.S. Rep. Gabrielle Giffords, resigned to recover from injuries suffered in a Jan. 8, 2011 assassination attempt. Six people were killed in the shooting and 13 were injured, including Barber.

Barber congratulated McSally Wednesday, and McSally thanked him for his service.

In interviews Wednesday, McSally said the campaign was challenging and intense.

A lighthearted commercial toward the end of the campaign changed the tone a bit. It poked fun at the many attack ads seen on Tucson TVs and involved McSally answering attacks from an announcer — including “McSally dislikes puppies!” — while holding a puppy.

“I think it was the first and only commercial I was able to show a little bit of my personality and just kind of laugh,” she said. “It really connected with people at the exact right time.”

McSally’s deputy campaign manager has since adopted the puppy from the Humane Society and named him Victory.

Contact reporter Becky Pallack at bpallack@tucson.com or 573-4251.