A man who claimed Texas' version of a stand-your-ground law allowed him to fatally shoot a neighbor after an argument about a noisy party was sentenced Wednesday to 40 years for murder.

Raul Rodriguez, 46, had faced up to life in prison for the 2010 killing of Kelly Danaher.

Rodriguez, a retired Houston-area firefighter, was angry about the noise coming from a birthday party at his neighbor's home. He went over and got into an argument with 36-year-old elementary school teacher Danaher and two other men at the party.

In a 22-minute video he recorded on the night of the shooting, Rodriguez can be heard telling a police dispatcher "my life is in danger now" and "these people are going to go try and kill me." He then said, "I'm standing my ground here," and fatally shot Danaher and wounded the other two men.

Rodriguez's reference to standing his ground is similar to the claim made by George Zimmerman, a neighborhood watch volunteer who is citing Florida's stand-your-ground law in his defense in the fatal February shooting of an unarmed teenager, Trayvon Martin. Rodriguez's case, however, was decided under a different kind of self-defense doctrine.

Prosecutors called Rodriguez the aggressor who took a gun to complain about loud music and could have safely left his neighbor's driveway in Huffman, an unincorporated area about 30 miles northeast of Houston, any time before the shooting. Defense attorneys argued Rodriguez was defending himself when one of the men lunged at him and he had less than a second to respond.

At trial, prosecutors tried to show Rodriguez had a history of not getting along with Danaher and other neighbors.

One neighbor testified that Rodriguez, who had a concealed handgun license, bragged about his guns and told her a person could avoid prosecution in a shooting by telling authorities you were in fear of your life and were standing your ground and defending yourself. During the trial's punishment phase, neighbors, former co-workers and Rodriguez's ex-wife testified that Rodriguez was abusive, a bad neighbor and that he once shot a dog.

Rodriguez's attorneys did not present any witnesses before the jury convicted him on June 13. But during the punishment phase, they called more than a dozen witnesses, including his wife and sons. They and other family members testified that he was not abusive, always stressed the importance of gun safety and that he was not cavalier with his weapons. One son said Rodriguez shot the dog because it was attacking his family.

Texas' version of a stand-your-ground law is known as the Castle Doctrine. It was revised in 2007 to expand the right to use deadly force. The new version allows people to defend themselves in their homes, workplaces or vehicles. It also says a person using force cannot provoke the attacker or be involved in criminal activity at the time.