The act will come into effect 24 months after the law is published, following its ratification by the Lebanese president, prime minister and defence minister, officials said.
During a heated parliamentary debate, several MPs called for an immediate abolition of the service, which recruits nearly 20,000 young men into the army each year, or for the law to be scrapped within a year.
For the time being, the law also upholds exemptions for only sons and university students, who can defer their entry into the military.
Parliament also voted to reduce military service for the time in remains on the books from one year to six months.