An armed father is being hailed as a hero after he shot dead a masked gunman who opened fire at a McDonald's in Alabama over the weekend.

The Birmingham store's manager had been unlocking the door so that the father and his two teenage sons could leave around 10.45pm on Saturday when the gunman suddenly burst inside.

Two witnesses said they heard more than a dozen shots as the gunman opened fire on the restaurant.

But the father was also carrying a weapon and was able to quickly return fire. He struck the shooter, who later died from his injuries.

An armed father is being hailed as a hero after he shot dead a masked gunman who opened fire at a McDonald's (pictured) in Birmingham, Alabama on Saturday night

Markus Washington (pictured) was finishing up his shift at the restaurant when he heard gunfire and ran into the freezer with another employee

The father and one of his sons had also been hit during the shooting and were taken to the hospital with non-life threatening injuries.

Markus Washington was finishing up his shift at the restaurant when he heard gunfire.

'I was making two quarter-pounders and heard three shots ring,' he told WBRC.

Washington and another employee ran into the store's kitchen and hid in the freezer as he continued to hear more shots being fired.

'All we hear is like different gunfire, so in my mind, I'm imagining everybody is dead,' Washington said.

The Birmingham store's manager had been unlocking the door so that the father and his two teenage sons could leave around 10.45pm on Saturday when the gunman burst inside

Washington and another woman said they heard more than a dozen shots as the gunman opened fire on the restaurant

One woman who had just ordered food at the drive-thru heard eight or nine shots ring out, she told AL.com.

She then saw people running out of the McDonald's, including children, before hearing two more shots fired.

Authorities said the father and his injured son are currently recovering in the hospital.

The gunman was also taken to a local hospital after the shooting, where he was pronounced dead.

Police have yet to release the names of the gunman or the man who took him down.

It also remains unknown if the shooting happened during a robbery, or if the gunman was trying to target an employee inside the restaurant.

The woman who had just ordered food at the drive-thru (pictured) heard eight or nine shots ring out and saw people running out of the restaurant

Washington said he is 'feeling grateful' that the armed father was there at the right time.

'He's my hero,' Washington said. 'Because I can only imagine how it would've went if he wasn't armed.'

Authorities do not plan to press charges against the father.

'Things like this are difficult for both families. The gentleman who unfortunately lost his life, the teenage boy who is in the hospital recovering from his injuries and the father who is also recovering from his injuries,' said Birmingham Sgt Bryan Shelton.

'It's not easy being a father and watching your child get injured, get hurt like that. It's a really heart-wrenching experience.'

'Right now it appears the victim made a decision that cost his life and the father made a decision that preserved his and children's lives.'