Medical school might be your ticket into the millionaires' club — provided you can repay the debt you'll incur on the way.

Indeed, many of the nation's highest-paying occupations are in the health-care field, according to a GoBankingRates analysis of 2017 compensation data from the U.S. Bureau of Labor Statistics.

Anesthesiologists are the top earners in the U.S., bringing in an average salary of $265,990.

Surgeons follow close behind, with an average annual salary of $251,890, while obstetricians and gynecologists earn an average of $235,240, according to the data.

See below for the top 20 professions, ranked by salary.