HARRIS COUNTY, Texas – A man who had barricaded himself in his vehicle in a McDonald's parking lot with a gun on Thursday shot himself after an hour-long standoff, according to authorities.

Deputies said the man was barricaded inside the restaurant in the 10900 block of Fry Road around

Authorities said they received a call from the man's girlfriend around 6:30 p.m. She said her boyfriend told her that he was going to kill himself and also threatened to harm other family members. She said he told her that he was on his way to the clinic where she works.

Deputies located his vehicle when he was northbound on Fry Road. After attempting to pull the vehicle over for several blocks, deputies said the man pulled into a parking lot at Fry Road and Cypress North Houston Road and put a gun to his head.

Deputies tried to talk the man down for more than an hour before he shot himself in the head, according to authorities.

The man was taken to the hospital in critical condition.

The investigation is ongoing.