DAMASCUS — Mortar shells hit a Damascus University outdoor cafe in the heart of the Syrian capital Thursday, state television reported, killing at least 12 students in an attack the government attributed to insurgents, who have struck with increasing audacity at President Bashar Assad’s epicenter of power in recent weeks.

The main rebel fighting group denied responsibility, asserting that it would never target a school filled with students, and suggested that Assad’s agents had carried out the attack to inflame passions against the two-year rebellion in Syria.

The attack at the outdoor cafe, near the civil engineering faculty building, was one of the deadliest to afflict an affluent enclave of Damascus that had been largely insulated from much of the fighting. An orange-and-yellow awning that had shielded cafe tables was drooped and riddled with holes. Pools of blood congealed on the concrete patio, littered with upended plastic chairs and packs of Gauloises and Winston cigarettes.

Assad’s government has actively sought to incubate an aura of normalcy in the center of Damascus despite the mayhem that has flared in other parts of the capital, but that effort has increasingly faltered. In recent weeks, central Umayyad Square and the nearby Tishreen presidential palace have been targeted in insurgent mortar attacks, although there had been few casualties.

Last week, a bombing at a Damascus mosque near Assad’s Ba’ath Party headquarters killed more than 40 people, including the country’s top Sunni Muslim cleric. The insurgency and the government blamed each other for that bombing.

Students interviewed after the attack on the outdoor cafe said it had been carried out as the civil engineering school was conducting an important exam. Normally, they said, at least 400 students would have been taking the exam, but increasing fears of war-related violence had led to heavy absenteeism, and the number of test takers was more like 50.

The Associated Press, quoting an unidentified Syrian official, said at least 20 people were wounded in the university attack.

State media blamed the attack on what it called terrorists, the government’s generic term for armed rebels who have been fighting to topple Assad, calling it a ‘‘barbaric massacre.’’

Loaey Mikdad, a spokesman for the Free Syrian Army, the main rebel fighting group, denied responsibility.

‘’This is just inhumane, and we would not do it,’’ Mikdad said in a telephone interview.

It is certainly not the first time during the conflict that university students have been killed or wounded on campus. Two months ago more than 80 people were killed at Aleppo University — also during exams — when multiple explosions possibly caused by airstrikes or bombs struck near a dormitory complex. The Assad government and insurgents accused each other of responsibility in that attack.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.