A man shot and wounded two security officers at an entrance to the Pentagon near a busy commuter rail station on Thursday before being fatally wounded in a shootout, officials and media reports said.

The gunman, identified in media reports as 36-year-old John Patrick Bedell of California, was apparently trying to gain entry to the giant U.S. Defense Department headquarters, Pentagon police chief Richard Keevill told reporters.

The security officers' wounds did not appear to be life-threatening, Pentagon officials said in a statement.

He walked up very cool, Keevill said. He had no real emotion on his face.

Several media reports early on Friday stated that the gunman died of wounds sustained in the shootout at the Pentagon entrance.

Instead of presenting a Pentagon pass, which is required to enter the building, the gunman pulled out a gun, Keevill said. Three Pentagon security officers exchanged fire with the suspect, and two were wounded.

The underground Metro station is adjacent to the main entrance of the Pentagon in Arlington, Virginia, just across the Potomac River from Washington. People can approach the Pentagon unimpeded from the Metro station.

All entrances to the five-sided building were closed after the shooting at 6:40 p.m. (2340 GMT) during the evening rush hour. The entrances were later reopened, except the one adjacent to the Metro station.

(Reporting by Adam Entous, Deborah Zabarenko and Will Dunham; editing by Philippa Fletcher)