LARAMIE, Wyo. (AP) _ A judge today barred defense lawyers attorneys from using a ``gay panic'' defense in the murder trial of a man accused of beating gay college student Matthew Shepard.

State District Judge Barton Voigt told lawyers for Aaron McKinney that the strategy was, in effect, a temporary insanity or a diminished capacity defense, both of which are prohibited under Wyoming law.

McKinney, 22, is charged with first-degree murder, kidnapping and aggravated robbery in Shepard's death last year. The 21-year-old University of Wyoming political science major suffered at least 18 blows to the head.

Prosecutors say McKinney and Russell Henderson, 22, posed as homosexuals, lured Shepard out of a downtown bar, drove him to a remote fence, tied him to it and pistol-whipped him into a coma. Police said robbery was the main motive but that Shepard may also have been singled out because he was gay.