(Adds detail, context)

BRASILIA, Oct 27 (Reuters) - Brazil is working to bring the Boeing 737 MAX airplane back to service "by the end of the year," Civil Aviation Secretary Ronei Glanzmann said on Sunday.

The MAX has been grounded for months after two deadly crashes, and U.S. airlines do not expect to see it return to service before 2020, according to their flight schedules.

Glanzmann's statement is the first by Brazil's government on the Boeing issue. Brazil's civil aviation regulator has been working closely with the U.S. Federal Aviation Administration on getting the plane back in the skies.

Brazil's largest domestic airline, Gol Linhas Aéreas Inteligentes, is a major MAX customer, and has ordered over 100 of them.

Glanzmann made his remarks during an airline industry conference in Brasilia organized by ALTA, a group that represents the interests of Latin American carriers. (Reporting by Marcelo Rochabrun; Editing by Lisa Shumaker and Nick Zieminski)

tag