NORTH MIAMI, Fla. -

A North Miami police officer shot a man who police said fired at detectives as they tried serving him a warrant for attempted murder.

The shooting happened near an apartment building at Northeast 6th Avenue and 144th Street in North Miami about noon Friday.

"They've been out here all morning, targeting this one building right here in the hopes of arresting him and locating him," said Barry Golden with the U.S. Marshals Service.

Police said Joe Fernandez was being served a warrant by the U.S. Marshals Task Force with North Miami and Miami-Dade officers assisting.

"They spotted the suspect, the suspect spotted the police officers, he began to run," said North Miami Police Major Neal Cuevas.

Police said Fernandez, 36, ran from the task force, turned back around, shot at them, and a North Miami police officer then returned fire, shooting him in the arm and the leg.

"He is a good officer -- he was called here as a backup," said John Rivera, President of the Police Benevolent Association.

"There were shots being fired by him, indiscriminately obviously, and who knows where those bullets might have ended up," said Cuevas.

Fernandez was taken to Jackson Memorial Hospital in stable condition.

North Miami Elementary School was put on lockdown during the shooting.

Fernandez was wanted for attempted murder in Okaloosa County. Investigators said Fernandez shot a woman about six times in an attempted robbery near Ft. Walton Beach on August 1.

Police said Fernandez will also be charged with attempted murder of a law enforcement officer.

"Our task force, they usually target the worst of the worst, and this guy is one of those fugitives," said Golden.

That Task Force is the very same fugitive hunting, warrant serving team for which Miami-Dade officers Amanda Haworth and Roger Castillo were working when their target shot and killed them a year ago January. Their teammate, Oscar Plasencia, was on the same job Friday at the North Miami scene.  Plasencia was the officer who shot and killed the fugitive who had killed his partners.

Fernandez was being held at the Miami-Dade County jail on no bond.

Fernandez has been arrested at least 13 times previously, said police.