The “coward” gunman who shot up an NYPD station house in The Bronx early Sunday, wounding a lieutenant, only surrendered after he emptied his clip, according to department Commissioner Dermot Shea.

Alleged shooter Robert Williams stormed into the 41st Precinct station house on Longwood Avenue around 8 a.m. and opened fire, according to harrowing video of the brazen assault and police sources.

“He immediately pulls out a gun and fires multiple rounds towards the desk area,” said Shea in a press briefing. “He then walks into an area beside that desk and fires several rounds.”

In the barrage, a lieutenant, identified as Jose Gautreaux, was struck in the upper left arm, Shea said.

The shooter quickly threw himself down to the station-house floor — but not because he had a change of heart, said Shea.

“I will point out that this coward immediately lay down, but only after he ran out of bullets,” said Shea.

Once the bullets stopped flying, the suspect was taken into custody by a flood of Finest, and taken to an area hospital, for unspecified injuries suffered in the fracas.

He is also suspected of ambushing another neighborhood cop sitting in a marked department van on Saturday night, firing a round that nearly struck that officer’s carotid artery, sources have said.

Both that officer and Gautreaux are expected to make full recoveries, said Shea.

Lieutenants Benevolent Association president Lou Turco characterized the shooter as a “career criminal,” and Shea noted that he was convicted of attempted murder in 2002 — in an incident also involving a shoot-out with cops.

In that incident, he shot a person, carjacked a passing motorist, crashed that vehicle, and then got traded bullets with the NYPD before his apprehension, said Shea.

The suspect also had a court date for another case in the coming days, said Shea, not revealing any details of that incident.

Shea, joined by city leaders including Mayor Bill de Blasio, denounced Sunday’s attack.

“This is not a liquor store robbery interrupted,” said Shea. “This was a premeditated assassination attempt.

“It is only by the grace of God … that we are not talking about police officers murdered inside a New York City police precinct.”

Added de Blasio, “This was an attempt to assassinate police officers. We need to use that word, because it was a premeditated effort to kill.

“Picture yourself on a Sunday morning at work and bullets start flying all around you,” said de Blasio. “This is what we ask of our officers.”