A PSNI helicopter was sent on a search mission after a Bangor man made a hoax call to say he was going to attack a house with a gun, a court has heard.
Specialist firearms officers were also deployed after the man claimed he was en route to the house with a pistol.
A judge was told Jackie Johnston's "bizarre" behaviour could have resulted in him being shot by police.
Mr Johnston, 28, of Ballyree Gardens, faces charges of wasting police time and making a false report of an offence
He is also accused of sending a message by a telecommunications system to cause annoyance or inconvenience.
Mr Johnston is further accused of two counts of possessing an offensive weapon, namely a knuckle duster and Stanley Knife, and making multiple threats to kill over an incident two days later.
Prosecutors said the helicopter, which costs £1,600 an hour to put in the air, was deployed because the incident was taken so seriously.
The court heard police were told in a phone call on 30 June that Mr Johnston had been seen loading a semi-automatic pistol and claiming to be on his way to shoot up the house in question.
A search operation launched in the Bangor and Ballynahinch areas failed to locate him.
Crown counsel Kate McKay said a man who identified himself as Mr Johnston phoned police the next day asking why his mother's home had been searched and the helicopter used.
She told the bail hearing: "He stated 'Do you think I'm running about with a machine gun like Rambo?'"
Mr Johnston was subsequently arrested and charged with the offences before the court.
After disclosing the cost of using the helicopter, Mrs McKay added: "There have been incidents of this type in England, of people running amok with guns.
"The matter was taken very seriously. A lot of police resources and time was spent on it.
"Police are not sure what he will do next because of this bizarre way he has been behaving."
Defence barrister Richard McConkey stressed that no gun was ever involved in the incident.
He said Mr Johnston could not remember making the phone call but had shown remorse and even offered to make a payment towards the costs.
He said Mr Johnston denied making threats to the brother and sister whose house was threatened.
Granting bail, Mr Justice Treacy banned the accused from entering either Ballynahinch or Downpatrick, and told him to have no contact with any alleged victims or witnesses.
He also imposed an alcohol prohibition and directed Johnston to seek assistance from his doctor within 48 hours of being released.