Police in Midlothian have now charged a man after a firearm was discharged in Dalkeith.
The incident took place on Woodburn Road and was reported around 12.10am on Sunday 18 June.
No one was injured and it does not appear that any damage was caused to the property.
Searches took place at properties on Meadowfield Terrace in Edinburgh and Kippielaw Steading in Dalkeith on Monday 19 June in connection with the investigation.
A firearm has since been recovered as part of ongoing enquiries.
Chief Inspector Kenny Simpson, Area Commander for Midlothian, said: “I want to stress this was an isolated incident and we are not looking for anyone else as part of this investigation.
“Nevertheless, we fully appreciate the impact this had on the local community and extensive inquiries were launched along with dedicated high-visibility patrols.
“A swift arrest has now been made and I want to thank residents for their assistance and support.
“Offences involving firearms will not be tolerated and should such crimes occur we will use all resources at our disposal to bring anyone found to be involved to justice.”
The 36-year-old is expected to appear at Edinburgh Sheriff Court on Tuesday 20 June.