Allan Dickson was deemed to be "highly irresponsible and reckless" at a disciplinary hearing of the General Teaching Council Scotland (GTCS).
The Newbattle Community High teacher was convicted last March at Edinburgh Sheriff Court of a breach of the peace and contravention of the Firearms Act and was suspended from his teaching post at the school until he finally left last June.
He has now been banned from teaching and will not be eligible to apply to get back on to the register for at least a year.
Mr Dickson appeared in person at the disciplinary hearing in the GTCS's headquarters in Clermiston Road yesterday.
He was represented by his friend, Adam Scarcliffe, who told the panel that Mr Dickson was sorry for bringing the GTCS and the education profession into "disrepute".
He said: "This was the first offence Allan has ever committed. This offence is one that is totally out of character.
"He is passionate about his job.
I would respectfully ask you to levy a punishment that would allow Allan to return to the profession that he loves."
Mr Dickson, was fined 1,000 by a sheriff for his offences.
The court was told how he had been on a night out drinking with workmates in July 2008 and got home to Granton Mill Drive to discover the gang outside.
He claimed he was assaulted and ran into his home to retrieve the pistol, firing three or four shots into the ground.
At yesterday's disciplinary hearing, solicitor Paul Marshall advised the committee that Mr Dickson's convictions were so serious that they would have no other choice than to remove him from the register.
He said: "The only responsible course in this case is to remove the respondent from the register."
In a letter written in his defence, Mr Dickson said that he was currently undergoing counselling for a drink problem.
Carole Ford, convener of the disciplinary sub-committee, said the panel had considered a number of "mitigating factors" including the two character references, Mr Dickson's "deep regret" and the fact he is dealing with his alcohol problem, but that the sub-committee was unanimous in its decision to remove Mr Dickson's name from the register.