The High Court in Edinburgh heard the gun had belonged to Cochrane's father
A grandmother from Dundee is facing a five-year jail term for possessing a 'family heirloom' pistol.
Gail Cochrane, 53, had kept the gun for 28 years following the death of her father, who had been in the Navy.
But police found the weapon, described as a "trophy of war", when they were looking for her son last year.
Cochrane admitted illegal possession of the gun, which carries a minimum sentence of five years imprisonment without "exceptional" circumstances.
Advocate Leanne Cross told the High Court in Edinburgh police had arrived at Cochrane's home in Dundee on 17 June with an arrest warrant for her son.
The accused had no idea of the potential ramifications for her in respect of possession of this weapon
Advocate Jack Brown
The grandmother-of-six allowed the officers to search the premises for her son, who had failed to turn up for a court appearance.
He was not at the flat, but the 80-year-old handgun was found underneath a mattress in the bedroom, which Cochrane admitted was hers.
When she was interviewed, Cochrane told police that the gun had previously belonged to her father and that she had kept it when he died.
She said she believed it was a real gun, but had no ammunition for it.
The weapon was sent for examination by firearms experts who concluded that it was a Czech-made pistol dating back to about 1927.
Ms Cross said the weapon was in poor external condition and had a faulty safety catch and trigger mechanism, but was in working order and could fire bullets.
She said Cochrane's son was traced and confirmed that the weapon belonged to his mother and had been in the family for decades.
Cochrane admitted having the 7.65 millimetre Browning self-loading pistol at her home, on June 17, without a firearms certificate and possessing the prohibited weapon without the authority of the Secretary of State or Scottish ministers.
Her defence solicitor Advocate Jack Brown said if there was a category of individuals who were most unlikely to commit such offences Cochrane would "fall squarely into that list".
"Suffice to say the accused had no idea of the potential ramifications for her in respect of possession of this weapon," he added.
He said she now acknowledged that she had pled guilty to very serious offences but added there were "extremely unusual circumstances".
Mr Brown said a firearms expert who looked at the elderly gun had described it as "a trophy of war", which reflected the circumstances of how it came to be in her possession.
Judge Lady Smith told Cochrane that she would call for a background report on her before sentencing and agreed to continue her bail.
She said her starting point in sentencing would have to be that the legislation required her to impose five years imprisonment, unless there were exceptional circumstances relating to her or the offence.
"Make no mistake the offences to which you have pled guilty are a very serious matter," she added.