The firearm turned out to be a pellet gun.
The incident happened at the In-N-Out at Blackstone and Swift at about 1 pm.
Police say they had seen the suspect walking on the street waving the gun before he entered the restaurant.
When he walked in and went into the In-N-Out bathroom, customers were immediately evacuated and officers surrounded the building, entered the restaurant and got the suspect to come out.
He was taken into custody without incident.