Police have now charged a man after a firearm was discharged at a house in Woodburn Road, Dalkeith around 12.10am on Sunday morning.
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.
John graduated from Telford College in 2010 with an HNC in Practical Journalism and since then he worked for the North Edinburgh News, The Southern Reporter, the Irish News Review and The Edinburgh Reporter. In addition he has been published in the Edinburgh Evening News and the Hibernian FC Programme.