BROOKLYN - Three NYPD officers are recovering after being wounded in two separate shootings Thursday night, including two in Brooklyn.

According to authorities, 32-year-old Lucas Kazicki was shot three times in the legs and groin area, and 27-year-old Michael Levay was hit in the lower back while in a Manhattan-bound "N" train on Fort Hamilton Parkway in Dyker Heights.

Investigators say Kazicki and Levay were in plainclothes when they confronted the suspect for moving illegally between cars. Levay was able to return fire after being shot, killing the suspect. A passenger was grazed in the leg during the gunfight, but no one else was injured.

Just one hour earlier, police say off-duty officer Juan Pichardo was wounded during an attempted robbery at his family's car dealership in The Bronx. Four men have been arrested in connection with that shooting.

Officers Kazicki and Levay left the hospital today and are recovering at home.  Officer Pichardo is currently recovering at Jacobi Medical Center.