A 50-year-old Alamo contractor accused of shooting a jewelry-store owner was on the verge of losing his cul-de-sac home and intended to rob a man he had treated as a friend in a desperate attempt to stay afloat, a prosecutor said Thursday.

Thomas Paul Bennett was charged Wednesday with attempted murder, attempted robbery, commercial burglary and enhancements for allegedly using a gun in a shootout last week in which both he and Alamo Jewelry Mart owner Oscar Herrera were critically wounded.

Bennett was no stranger to Herrera, said Bruce Flynn, a Contra Costa County deputy district attorney. The two men were on a first-name basis.

"It was more than just a casual guy coming in once in a while to look at merchandise," Flynn said.

The night of Dec. 3, however, Bennett armed himself with three guns - including a .22-caliber weapon outfitted with a homemade silencer - and drove to the jewelry store in the Alamo Square Shopping Center to try to rob Herrera, Flynn said.

Herrera, 53, told investigators that Bennett came into his store at about 7 p.m., pulled a gun and said he had to rob him to save the home where he has lived for eight years with his wife, son and daughter, Flynn said.

"Mr. Bennett told him that he was losing his house," Flynn said. "Robbery definitely was the motive all along here."

Something went wrong, however, and Bennett opened fire with a 9mm semiautomatic handgun, striking the Hercules resident in the chest and abdomen, Flynn said.

While pleading for his life, Herrera managed to move to the back of the store and grab his own handgun, Flynn said. Then he shot Bennett in the neck, mouth and wrist, the prosecutor said.

Sheriff's deputies who converged on the store whisked Herrera to safety, but Bennett refused to give up, instead pointing one of his guns at his head and threatening suicide, said sheriff's Capt. Dan Terry. Bennett finally surrendered after an hour.

Both men remain hospitalized at John Muir Medical Center in Walnut Creek. They are expected to survive.

Public records show that Bennett and his wife, Sutton, were notified in August that they were $35,631 in default on their six-bedroom, 6,200-square-foot home on Cole Court, which they bought in 2001 for $1.2 million.

On Nov. 27, the couple received a "notice of trustee's sale" detailing an unpaid balance of $2.3 million and indicating that their home would be sold at public auction Dec. 21, records show.

Police seized about a dozen weapons and ammunition from the home, Terry said. "He had a cache of weapons at the house," he said.

Bennett operates Bennett Construction from the home. Advertisements indicate he specializes in window and door work.

Relatives of both Bennett and Herrera have declined to comment.

"People make bad decisions. This was a bad decision," Flynn said of Bennett. "He had other options available to him, and he chose this option, which is going to cost him."