New York City health officials are urging some men to get vaccinated against meningitis amid an outbreak that has sickened 22 New Yorkers and killed seven.

The dangerous strain of bacterial meningitis appears to be spreading through sexual encounters between men who meet through websites or smartphone apps, or at bars or parties, according to the City's health department. More than half of the infected men have had HIV, a virus that attacks the immune system making infections more likely and more severe.

"Vaccination is the best defense," City health commissioner Dr. Thomas Farley said in a statement. "I urge all men who meet these criteria - regardless of whether they identify as gay - to get vaccinated now and protect themselves from this disease before it is too late."

Bacterial meningitis is an infection of the brain's membranous lining, called the meninges. Early symptoms include fever, headache, vomiting, stiff neck and a rash within 10 days of the infection. If left untreated, the disease can cause severe brain damage and even death, according to the U.S. Centers for Disease Control and Prevention.

The disease is spread by "prolonged close contact with nose or throat discharges from an infected person," the health department said in a September 2012 statement after the death of a patient. While vaccination can help prevent new infections, "people that have been in prolonged close contact with infected people need to see their health-care provider immediately to receive preventive antibiotics," the department added.

Men from all five boroughs have been infected, health officials said, declining to comment on the kinds of websites or apps involved in the outbreak.

"I strongly recommend all men who have intimate contact with other men get vaccinated," Brooklyn Borough President Marty Markowitz said in a statement. "This disease is both potentially fatal and extremely contagious, so increasing the public's awareness to this growing issue and encouraging vaccination are of the utmost importance."

New Yorkers are advised to call 311 or search "meningitis" at nyc.gov for more vaccine information.