Chip Somodevilla / Getty Images Floyd Corkins pleaded guilty to storming the Washington headquarters of a conservative Christian group Aug. 15, 2012, because of its opposition to gay rights.

Floyd Lee Corkins, the man who shot up the Washington, D.C., offices of the conservative Family Research Council last year, was sentenced to 25 years in prison Thursday after prosecutors likened him to the Navy Yard gunman.

Corkins, 29, pleaded guilty in February to storming the council's headquarters Aug. 15, 2012, because of its opposition to same-sex marriage.

The council's unarmed security guard was shot in the arm before he subdued Corkins despite his injuries.

Assistant U.S. Attorney Patrick Martin asked for a 45-year sentence, arguing Thursday that the only difference between Corkins and Navy Yard shooter Aaron Alexis was that the security guard was able to stop Corkins in time.

"Mr. Corkins was this close to accomplishing that," Martin told U.S. District Judge Richard Roberts, The Washington Post reported. "He was no less determined than the Navy Yard gunman. He was no less prepared."

U.S. Marshal Service Floyd Lee Corkins told the FBI he intended 'to kill as many peopl as possible' at the Family Research Council.

The incident came a few weeks after it was reported that the fast-food company Chick-fil-A's charitable foundation had made millions of dollars in donations to organizations fighting efforts to legalize same-sex marriage. The Family Research Council, an evangelical Christian activist group, came out strongly in support of the company.

In a sentencing report filed in April (.pdf), prosecutors said Corkins told FBI agents that he wanted "to kill as many people as I could ... then smear a Chicken-fil-A [sic] sandwich on their face."

It said he was carrying 15 Chick-fil-A sandwiches in his backpack, along with a box of 50 rounds of 9mm ammunition.

Corkins told investigators he had been thinking about such an attack for years but hadn't mustered up the courage to go through with it, according to the sentencing report.

Then came the news about Chick-fil-A. Corkins said he hoped "to make a statement against the people who work in that building ... and with their stance against gay rights and Chick fil-A."

"They endorse Chick-fil-A and also Chick-fil-A came out against gay marriage so I was going to use that as a statement," he said, according to prosecutors.

Corkins was wrestled to the ground by Leonardo Johnson, the security guard whom he shot in the arm. In court Thursday, the judge told Corkins, "The carnage you wanted did not happen only because an ordinary man showing extraordinary courage stopped you."

Johnson, who was joined in court by several colleagues at the Family Research Council, told Corkins: "Although I forgive you, I will never forget. I don't know if I'll ever be the same again."

Watch US News crime videos on NBCNews.com