Associated Press

EULESS, Texas — A Texas police officer who died after a gunfight had moved from New York City to the Dallas area because he wanted to be somewhere safer, his mother says.

Officer David Hofer, 29, died Tuesday during surgery following a gunfight with an armed suspect in a park near a Dallas-area school.

A 2008 graduate of New York University, Hofer served in the New York Police Department for five years before coming to Euless in 2014, Police Chief Mike Brown said.

The New York Post reported Hofer, the son of European immigrants, formerly worked in the 9th Precinct on Manhattan's Lower East Side.

"He was wonderful child, a wonderful police officer," his mother, Sofija Hofer, told the newspaper. "He was working this very difficult precinct, so he had a lot of traumatic experiences. ... He decided to go to a safer place. "

Brown said Hofer was one of the officers who responded to a report of shots fired around 3 p.m. Tuesday near J.A. Carr Park, which is in a residential area near an elementary school.

"Upon arrival, officers encountered a suspect with an unknown weapon," Brown said. "The suspect immediately fired upon officers, striking one of them. Officers returned fire, striking the suspect."

The suspect, who was not immediately identified, died of multiple gunshot wounds, the chief said. Two nearby schools were placed on lockdown until the situation was resolved.

Hofer's fiancée was out of town on Tuesday and needed to be called home and given the news, the Post reported.

Sofija Hofer said her son wanted to write a book about his experience with the NYPD.

"I thought he might be a scientist, like his father, but he always wanted to be a policeman, ever since he was a little boy," she said.

David Hofer is the second officer to die in the line of duty in Euless, a suburb of more than 53,000 residents west of Dallas and east of Fort Worth. The other officer was Michael Williamson, who was killed by a drunken driver in 1982, according to the city website.

Copyright 2016 Associated Press