Oxford is to get its first antisocial behaviour gates, to lock criminals and vandals out of two of its most notorious alleyways.

The historic Bulwarks Lane, in the city centre, and an alleyway between Windale Avenue and Pegasus Road, in Blackbird Leys, are to be shut off, after years of problems.

The decision by Oxfordshire County Council means Bulwarks Lane, which runs between New Road and George Street, will be closed from dusk until dawn each day, after a series of assaults, muggings and drug deals over the past six years.

However, the path will still be open during daylight hours, with nearby Nuffield and St Peter's colleges paying for the gates and locking and unlocking them.

The gates in the alleyway in Blackbird Leys will be locked 24 hours a day, with only a handful of residents being given keys to open and close them.

At a transport cabinet meeting at County Hall on Thursday, five city and county councillors called for the overnight closure of Bulwarks Lane. Carfax city councillor Paul Sargent said: "It's a delightful walkway during the day, but only after all the vomit and detritus has been cleared. After dark it takes on a very sinister nature."

Police logged 13 crimes in the alley last year, including six incidents of drug-taking, three of assault and one sexual assault.

However, Jane Baldwin of the Oxford Preservation Trust, opposed the gates. She said: "It's a street with great character, which visitors to Oxford are often charmed by.

"It's a very important public thoroughfare and one that helps us to understand the development of the city.

"Even if the gates are open, it will appear that it's no longer a public space. It will be a loss to the town and a great shame."

Residents and councillors who have campaigned for several years for the gates in Blackbird Leys, which will cost £8,250, said people power had won the day.

Sandra Witts said: "It's absolutely wonderful news. These gates will bring peace of mind for residents. It means so much to be able to get our quality of life back to normal.

"It has been awful, feeling threatened by what's going on outside your house. There will be a party among the residents.

"This wouldn't have happened without the parish council's persistent pursuit of the matter and the coverage we have been given in the Oxford Mail."

Even at the eleventh hour, the residents feared there might be another hitch. Jimmy Hayes, 69, whose home has been burgled by people using the alleyway to get into his garden, told the Oxford Mail on Thursday: "We're keeping our fingers crossed, but until they hand us the keys, we do not dare get our hopes up too much."

Gordon Roper, the chairman of Blackbird Leys Parish Council, said: "I'm so pleased. It's going to make a massive difference to the lives of residents."