South Korea on Tuesday confirmed the country's first two deaths from Middle East Respiratory Syndrome as it fights to contain the spread of a virus that has killed hundreds of people in the Middle East.

South Korea has reported 24 cases of the disease since diagnosing the country's first MERS illness last month in a man who had traveled to Saudi Arabia and other Middle Eastern countries. Most of South Korea's cases have had connections to the first patient -- either medical staff who treated him or patients who stayed near him at the hospital before he was diagnosed and isolated, and their family members.

Tests on a 58-year-old woman who died of acute respiratory failure Monday showed she had been infected with the disease before her death, the Health Ministry said in a statement. A 71-year-old man who tested positive for the virus last week also died, it said.

The statement said both stayed at the same hospital with the first patient.

Health officials said Tuesday that about 750 people in South Korea were isolated at their homes or in state-run facilities after having contact with patients infected with the virus. They said the number could rise and that depending on their conditions many of the isolated could be banned from leaving the country.

More than 50 schools and kindergartens near a hospital near Seoul where the 58-year-old patient who died was treated have canceled classes from Wednesday to Friday to let children stay home, according to the education agency in Gyeonggi province, which surrounds Seoul. The measure was taken after many parents asked the schools to take action, agency officials said.

There is a growing sense of public alarm over the virus, with South Korean media criticizing the government for failing to swiftly cope with MERS in the initial stage of its landing in the country. Major shopping malls have reported a sharp increase in sales of masks, hand sanitizers and mouthwashes, and many people have been seen wearing masks on Seoul streets over the past few days.

Last week, the son of one of the patients ignored doctor's orders to cancel a trip to China, where he was later diagnosed as that country's first MERS case. China isolated the South Korean man at a hospital, and Hong Kong authorities said Sunday that 18 travelers were being quarantined because they sat near him, but they were not showing symptoms.

MERS was discovered in 2012 and has mostly been centered in Saudi Arabia. It belongs to the family of coronaviruses that includes the common cold and SARS, and can cause fever, breathing problems, pneumonia and kidney failure. The virus has spread primarily through contact with camels, but it can also spread from human fluids and droplets.

There have been about 1,170 cases of the virus worldwide and about 480 of the patients have died, according to the European Center for Disease Prevention and Control.