O'Hagan joined the New York City Fire Department in 1947 at the age of 22, and quickly rose up the ranks. Appointed Chief of Department on December 16, 1964 at the age of 39, he was the youngest Fire Chief in FDNY history. Chief O'Hagan led the department through some of its most harrowing years, those dominated by the arson that plagued the city in the 1960s and 70s, a time when the city's bankruptcy forced the layoff of hundreds of firefighters.
He earned a reputation as a brilliant fire officer and a tough manager, despite his initial lack of knowledge of how to work the levers of city government. Even Chief O'Hagan, commanding a leader as he was, could not thwart a 1968 revision of the building code, drafted in large part by the real estate industry, that he thought thinned the margin of fire safety. Still, Chief O'Hagan did not give up.
He returned in 1973 with safety measures added to the code. But they did not apply to the World Trade Center, which, being owned by another government agency, the Port Authority of New York and New Jersey, was exempt from city codes — and fire inspections. On October 11, 1973 at the age of 48, he was appointed Fire Commissioner by Mayor Lindsay.
He retained his position as Chief of Department while serving as Fire Commissioner. He was the author of High Rise/Fire & Life Safety in 1977 and was an international authority on fire administration and fire safety. He officially retired from the FDNY on July 18, 1978, after 31 years of service.
He died on January 2, 1991 in Brooklyn, New York of cardiopulmonary arrest from cancer.