Joseph Pfeifer was working as an FDNY battalion chief one morning in 2001 as two French filmmakers happened to be shadowing him.

But then the World Trade Center was attacked.

The filmmakers ended up documenting the bravery of so many first responders, including Pfeifer, who made the first official report of the attack and set up a command center inside the building.

"I saw the first plane aim and crash into the World Trade Center, and I knew this was a terrorist attack," Pfeifer said.

It is a day Pfeifer says he doesn't think about much, even though his firefighter brother, Kevin, and so many friends and colleagues, were killed.

But as he prepares to say goodbye to the FDNY on Friday, retiring after 37 years of service, he says the experience has propelled him forward ever since.

"It's the background, or the foundation, to drive you forward, to say, 'This is really important work. So my days might be long, but they fly by,'" Pfeifer said.

Pfeifer is the last chief working on 9/11 who is still on the job. His retirement will mark the end of an era for the FDNY.

But his legacy will endure. He was named the FDNY's first chief of counterterrorism after 9/11. He created the department's Center for Terrorism and Disaster Preparedness, increasing training for such emergencies and creating inter-agency coordination that just didn't exist before.

Pfeifer spoke in an official capacity for the last time, at a National Homeland Security conference in Midtown on Wednesday.

"I had no idea that my career was going into this path. If you would have told me when I started that I was going to be the chief of counterterrorism, I would have said, 'What? You want me to do what?'" Pfeifer said. "But I think events change and things happen and instead of saying, 'You want me to do what?' I think what I wound up saying — and so many others — is, 'How can I help?'"

While Pfeifer's days at the FDNY are ending, he's still planning to work. He plans to teach courses in crisis leadership and disaster management at Columbia and Harvard.