Cops trying to subdue an emotionally disturbed man with a long rap sheet accidentally shot two female bystanders outside Port Authority Bus Terminal on Saturday night, source said.

Theodora Ray, 54, was struck in her leg — breaking two bones in her calf — as she stood leaning on her four-wheeled walker across from the terminal; Sahara Khoshakhlagh, 35, was grazed in her buttocks.

Two cops pulled off a total of three shots in the mistaken belief that the deranged Glen Broadnax, 35, was armed after he reached into his pocket as they approached him, officials said.

Broadnax took his hand out of his pocket and “simulated shooting the officers,” Police Commissioner Ray Kelly told reporters.

“He’s got a gun!” witnesses said someone in the crowd shouted just before shots rang out.

One police bullet sent Ray sprawling to the sidewalk grate, still clutching her walker.

She was rushed to Bellevue Hospital where Kelly visited her before speaking to reporters waiting outside.

Khoshakhlagh was taken to Roosevelt Hospital. Kelly visited her, too, prior to her release at 1:15 Sunday morning.

She left Roosevelt on foot, still wearing a hospital gown.

She left accompanied by a cop, a man in a suit, and a third man in casual clothes. When a reporter asked her to describe what happened, she was ordered not to speak by the man in the suit.

The chaos began a block from Times Square just after 9:30 p.m., when the hulking Broadnax ran into the bustling intersection of Eighth Avenue and 42nd Street.

“It was like he wanted to get hit,” one eyewitness, Fabiola Ferere, 30, of Queens, told The Post.

Police rushed to the scene, halting traffic and trying to subdue the crazed man, who somehow managed to avoid being struck by swerving and skidding vehicles.

“He was just running around avoiding police,” Ferere said.

“The police literally could not control him. He had to be on something, like narcotics or bath salts,” Ferere said.

“The individual was blocking traffic and appeared to be attempting to be hit by cars,” Kelly said.

“A minute after the shooting, dozens of police cars came down the street,” said Arken Assam, 43, a street photographer who takes pictures of tourists for money.

“Hundreds of people were just running,” said Assam, who himself took shelter in Madame Toussaud’s on 42nd Street.

Police finally brought Broadnax down with a Taser, then took him to Bellevue.

Broadnax is no stranger to cops, with at least 13 prior arrests, primarily for assault in Manhattan and The Bronx, according to law-enforcement sources. He’s also done two prison stints for robbery.

Kelly told reporters little of his conversation with the two victims.

“They weren’t 100 percent certain of what happened,” he said, describing their mindset after being shot.

“They’re in good spirits,” he added.

The two officers who opened fire are rookies, with 18 months and three years on the job.

Additional reporting by Kirstan Conley