Portsmouth magistrates ordered the immediate closure of 13 Niton Close, in Gosport, after seeing evidence of drug use in communal areas of the borough council's block.
Hampshire police said suspected drug dealing was going on at the block, with addicts smoking and injecting in communal areas.
Drug paraphernalia was seen and residents were being asked for cash.
The flat has now been sealed under a closure order until October 5. Entering it is a criminal offence.
Inspector Richard Thompson, from Gosport police, said: 'This action has been taken following an increasing number of reports of criminal behaviour associated with the address in recent months. We take these reports very seriously, especially when they relate to drugs.
'PC Mark Barber has undertaken some excellent work with his colleagues from the Gosport West Neighbourhood Policing Team to identify and resolve the issues reported to us by residents.
'We’ve worked with Gosport Borough Council to obtain statements and obtained photographic evidence, along with body worn video footage, leading to this successful application to the court. This was swift action which was also prompted by intelligence obtained from local beat officers and reports given to Gosport Borough Council’s housing team.
'It’s a great example of community policing working alongside partner agencies to ensure the safety and security of the residents of Niton Close.
'This type of activity has a huge impact on the wider community and people visiting the area.
'This order sends out a strong message that we will not tolerate this kind of behaviour and will use every available power to stop it.'
Cllr Mark Hook, leader of Gosport Borough Council, added: 'This kind of behaviour is unacceptable and we will not hesitate to take firm action, along with the police.
'We're very glad to get this excellent result in court for the people of Niton Close and the wider community.
'We're now considering all options, including eviction proceedings, to make sure the neighbours are protected from such activities in the future.'
The closure order was made on July 5 under the Anti-Social Behaviour, Crime and Policing Act 2014.