BEIRUT, Lebanon — In Lebanon, its people like to boast, you can take in pristine mountain villages and swim in the shimmering sea all in one day.

But the country’s blond-sand beaches are now scarred with plastic bottles and its mountain streams befouled by open dumps. The Mediterranean gurgles with toxic runoff from rotting garbage. A seemingly unstoppable proliferation of trash has marred Lebanon’s water, seafood and public health.

The government’s inability to provide basic services, including 24-hour electricity and garbage collection, is rooted in an agreement that ended Lebanon’s civil war nearly 30 years ago. The deal divided power between the nation’s 18 recognized religious sects, effectively institutionalizing corruption, with each group able to dole out government jobs, contracts, favors and social services to its followers.

The Lebanese have finally had enough of a system that has enriched the political elite while failing to build a stable economy or provide basics like reliable running water or consistent waste management.