ROME — With daily coronavirus case numbers rising, Italy on Monday imposed its first new restrictions on daily life since coming out of lockdown nearly four months ago, ordering the closure of nightclubs and mandating mask-wearing, even outdoors, in areas with nightlife.

The new measures come as Italy faces its most precarious moment of the summer. School is due to start in less than a month, Italians are moving en masse for their August holidays, and tourists are coming in from other European countries that have seen even greater increases.

Although the Italian restrictions are modest, they amount to a test of whether a country can keep the virus at bay without resorting to the blunt-force lockdown strategy used earlier in the pandemic. Italy’s government is specifically targeting nightclubs and evening socializing as cases are increasingly detected among the young.

“We cannot jeopardize the sacrifices made in these last months,” Health Minister Roberto Speranza said. “Our priority must be to safely reopen schools in September.”

After being ravaged by the virus in March and early April, Italy has since emerged as an example of how a careful reopening — and widespread adherence to rules — can help restore a sense of near normalcy. Italy in early March had the highest infection rate in Europe; throughout the summer, it has had one of the lowest rates. The number of people hospitalized in Italy with covid-19, the disease caused by the novel coronavirus, has fallen from 33,000 to 800.

But across the country, people have started to become more relaxed. Some shopkeepers and cafe owners wave off indoor mask-wearing obligations. And Italians have tried to reclaim some of their usual summer rites — zipping off to other Mediterranean countries while also welcoming visitors. Some 20 percent of Italy’s recent cases stem from citizens who have traveled abroad, according to the country’s National Institute of Health.

In Italy, the average age of an infected person has fallen to 35, down from the mid-60s earlier in the pandemic. The age reduction could be related partly to changes in testing patterns: At the beginning of the outbreak, Italy was administering tests to those who sought hospitalization, a disproportionately older group. Younger people are also likelier to be on the move for work.

But officials say the young have also become less cautious and risk being the starting point for contagions that spread to older family members.

“The reason [for the new cases] is mostly young people gathering and behaving like nothing has happened,” said Walter Ricciardi, the World Health Organization’s Italian government adviser. “There is quite a lot of movement by young people, going out of Italy for holidays and coming in. The circulation of the virus has been very intense.”

Most European countries in recent weeks have started to report growing coronavirus case numbers, although at levels well below of the spring peak. Over the past week, Italy has detected roughly 500 new cases per day, well above the 200-a-day pace from earlier in the summer but one-tenth of the peak. Health experts in Italy say they hope the country can avoid a true second wave. But there is concern about what will happen as school begins, temperatures drop and socializing moves to indoor spaces more hospitable for the virus.

Given the lag time between infection and when symptoms arrive, it will also take a few weeks before Italy sees whether its mid-August holidays further drove the spread of the virus.

In an interview with Il Messaggero, Agostino Miozzo, coordinator of a scientific committee advising the government, said he was “fairly worried” about the situation. Localized lockdowns could be necessary if cases continue to rise, he said.

“Within a couple of weeks, we’ll be able to gauge the effects of this summer’s ‘freedom for all.’ That is the real tragedy,” Miozzo said. “The pace of growth is evident. You don’t work miracles when dealing with figures.”

Italy’s decision to close nightclubs follows a similar move by Spain days earlier. The Italian government said just last month that nightclubs with open-air facilities could reopen, but some regional governments had given clubs a green light weeks earlier. Maurizio Pasca, head of an Italian association of nightclubs, said that only 20 percent of clubs nationwide had reopened and that they were operating at reduced capacities while requiring online reservations. They were also supposed to enforce social distancing, although that was proving unfeasible.

“The other rules were applied,” Pasca said. “Distancing could not be.”

But Pasca also wondered how closing nightclubs would solve the problem when people are gathering on beaches and piazzas as well.

Andrea Crisanti, a virologist at the University of Padua, said closing nightclubs is one step that could forestall the risk of a larger increase in cases. Such spaces “offer the best conditions to spread the virus,” he said.

“I was surprised they even allowed them to reopen in the first place,” Crisanti said. “It is surely a critical moment because cases are increasing, and even more critical because we have to react without resorting to a lockdown.”