NYPD Commissioner Ray Kelly’s son played detective today as he tracked a lunatic he had seen allegedly attacking McDonald’s workers in Washington – following the alleged perp for 15 minutes until local cops arrived.

Greg Kelly, co-host of Fox 5’s “Good Day New York,” had been covering President Obama’s Mid-Atlantic Inaugural Ball in the wee hours when he got a craving for a Big Mac – and walked into the burger joint just as a customer went berserk.

“This guy was smoking a cigarette, the workers told him to stop and he totally flipped,” the younger Kelly, a Marine veteran, told The Post.

“He grabbed a cash register and pushed it at a young girl working there with a great deal of force. He threw a potted plant in a fryer. He was grabbing everything he could get his hands on and throwing it.

“It was disturbing. I report on violence all the time, you see it on TV, and I saw it when I was in the Marines.

“But when you see it right in front of you and against ordinary people who were just trying to do their job, it was shocking.”

The gray-haired thug, who looked to be in his 40s and ranted that he was a Canadian tourist, ran off. Greg Kelly was hot on his tail.

“I was concerned that he would notice me, but he was oblivious,” he said. “I called 911 and gave them directions while I followed him.

“He went into a bar, and I waited outside until cops arrived.”

Greg then led the officers through the bar – crowded with people toasting the new president – until he found the culprit.

“I know it wasn’t a major crime, but it gave me a kind of adrenaline rush,” he said.

“It reminded me of when I was 4 years old and my dad would tell me his job was looking for bad guys.”

Kelly, 40, who served nine years as a fighter pilot before becoming a TV reporter, told his dad what he’d done today.

“My father kind of chuckled,” he said.

“He didn’t admonish me, so I guess he thought I’d done a good job.”

In fact, Ray Kelly was more shocked at his son’s choice of eating establishment than at the risks he’d taken.