CROSBY, Texas -

Two child care centers in Crosby went on lockdown Tuesday when an armed mental patient tried to enter one of them.

The 26-year-old man suffers from bipolar disorder and other mental problems according to Harris County sheriff's deputies.

When he became agitated and combative at his home Tuesday afternoon, so his mother decided to check hm into a hospital just after 3 p.m., officials said. But he jumped from her moving car in the 5700 block of FM 2100 and ran up to the door of Growing In Graces Child Care Center with a 9mm Glock pistol, according to officials.

Lisa Cunningham was inside picking up her 1-year-old daughter Hanna when she saw him through the window.

“I looked up and saw him run to the door with the gun and I yelled at them, 'There's a guy with a gun,'” Cunningham said. “I grabbed her, my kids, and they started shuffling the other kids back, but the doors locked so he couldn't get in.”

When he found the door locked, Cunningham said the man threw the pistol in some bushes in front of the day care center, and got back into the the car with his mother, who had followed him to the building.

As they continued north on FM 2100 the man jumped from the car again, lacerating his head as he exited the car. He ran past the Crosby Christian Academy day care in the 5500 block of FM 2100, and on down the street, officials said.

He was captured by deputies about a quarter mile from there.

Cunningham said she thanked the day care operator for doing the right thing at the right time.

“I told them, 'I am so glad that your doors worked.' If he had come in, who knows?” Cunningham said.

The suspect was arrested but not charged. Instead a judge issued an emergency detention order. The man is now being treated at the Harris County Psychiatric Hospital. He'll be held for observation for 90 days. Sheriff's deputies said he may still face criminal charges after that.