A new study finds the Orono and Bangor school districts among the 10 best in the state.

Regional School Unit No. 26 (MSAD 26), which includes the Orono schools, ranked sixth and Bangor ranked seventh (up from 11th in 2016) in the survey released last week by Niche, a company which uses government data and opinion-based surveys from students, alumni and parents to determine its rankings.

Other area school districts also fared well in the rankings. Hampden (RSU 22) ranked 11th and Brewer ranked 20th. Cape Elizabeth was the top-ranked district. Here are the complete rankings.

The survey measured each school district in eight categories, with academics accounting for 50 percent of the grade. Other categories included health and safety, teachers, facilities, and student culture and diversity.

In a separate ranking, Bangor High School was ranked as the 11th best public high school in the state. Brewer was ranked 21st (a big jump from 32nd in 2016) and Hampden Academy was ranked 23rd.

Maine School of Science & Mathematics in Limestone was the top-ranked high school in the state for 2017.

The company also released a list of the best private high schools in Maine. On that list, John Bapst Memorial High School ranked eleventh and the Bangor Christian Schools ranked thirteenth.