Navy Secretary Ray Mabus announced in May that he was planning to increase paid maternity leave for sailors from six to 12 weeks.

Then he doubled down. When Mabus finally unveiled his new policy last month, it was even more generous than promised – 18 weeks, effective immediately and retroactively to the beginning of 2015. Generous, that is, by U.S. standards. This is the only industrialized country that doesn’t mandate paid maternity leave for workers. Who would’ve guessed the armed forces would become the model for progressive family leave policy?

Mabus realized that if he wanted to compete with tech companies for skilled female workers, he had to do better than 12 weeks. Google, for example, offers mothers between 18 and 22 weeks of leave. Other companies such as Facebook offer similarly long parental leaves, for dads as well.

Thanks to Mabus’ decision, the Air Force is now considering 18 weeks of maternity leave. Ideally, other employers will also reconsider their policies.

The Navy’s calculation is that the one- or two-time cost of 18 weeks’ paid leave (the typical American mom has two kids) pays off in savings from not having to retrain replacement workers. When Google hiked its maternity leave, the rate at which new moms left the company was cut in half.

Women make up about half of the U.S. workforce but only about 25 percent of new recruits and only 18 percent of the Navy’s workforce. Female sailors leave the service in great numbers in years five and six, and the top reason is “family.” Family is also the No. 2 reason that men leave the Navy, and Mabus is pushing for more leave for new fathers as well as for sailors who adopt children.

By keeping women in the workforce, paid parental leave ensures that they retain their earning power. It also leads to lower infant mortality rates, healthier children and a happier workforce.

Yet only about 12 percent of U.S. workers have this benefit. That’s dismal. We should do better.