WASHINGTON — The Supreme Court ruled Monday that car dealerships’ service advisers are exempt under federal law from overtime pay requirements.

The court ruled 5-4 that service advisers, who greet customers and propose various repair services, are salespeople.

The case affects the more than 18,000 dealerships nationwide. Together, they employ more than 100,000 service advisers.

The case the high court made its decision in involves a Mercedes Benz dealership in Encino, Calif., and several current and former service advisers.

Each side had a different interpretation of the Fair Labor Standards Act, which says that “any salesman primarily engaged in selling or servicing automobiles” doesn’t have to be paid overtime.

The dealership argued that the definition of salesman clearly includes service advisers, who have a range of job responsibilities from helping to diagnose mechanical problems to preparing price estimates for repairs. Service advisers had argued they weren’t covered by the definition.

Justice Clarence Thomas wrote in a majority opinion that the “ordinary meaning of ‘salesman’ is someone who sells goods or services” and that service advisers “do precisely that.” In a dissent, Justice Ruth Bader Ginsburg wrote that because service advisers “neither sell nor repair automobiles” they should not be exempt from overtime payments.

The issue came to the high court after the Department of Labor changed its interpretation of the Fair Labor Standards Act in 2011.

For the three decades up to then, the department operated under the view that service advisers didn’t have to be paid overtime.

Monday’s decision was the second time the court has ruled in the case.