A legal adviser for Myanmar's ruling National League for Democracy was shot dead outside the country's busiest airport on Sunday, in a rare outbreak of what appeared to be political violence in the commercial capital, Yangon.

Police arrested a lone gunman, but a motive was unknown in the killing of 65-year-old Ko Ni, a prominent member of Myanmar's Muslim minority.

The apparent assassination comes amid heightened tensions in Buddhist-majority Myanmar, where leader Aung San Suu Kyi is under pressure over a heavy-handed security operation in an area of the country's northwest that is populated mostly by Muslims.

A gunman shot the lawyer in front of the main terminal of Yangon International Airport at about 5 p.m., according to San Naing, Ko Ni's assistant.

Images posted on social media show a man in a pink shirt, shorts and sandals aiming a pistol at the back of Ko Ni's head as he cradles a toddler. A family member said Ko Ni was holding his grandson when he was killed.

A taxi driver who tried to stop the gunman was also killed, according to Zaw Htay, spokesman for President Htin Kyaw.

"We have detained and are questioning the gunman to find out why he killed him, and who is behind it or paid him to do it," Zaw Htay told Reuters.

A police official told Reuters the suspect was a 53-year-old Myanmar citizen from the central city of Mandalay.

Ko Ni had just embraced his young grandson as he stepped out of the airport terminal on his return from Jakarta, said the lawyer's daughter Yin Nwe Khine.

"My father was talking to his grandson. Then I heard a gunshot. At first I thought it was a car tyre blowing out, then I saw my father lying on the ground," she said.

Ko Ni, an expert in constitutional law, had spoken out about the powerful role the military retains in governing Myanmar, despite handing over power to Suu Kyi's civilian administration in April.

"My father was often threatened and we were warned to be careful, but my father didn't accept that easily. He always did what he thought was right," said Yin Nwe Khine.

"A lot of people hate us because we have different religious beliefs, so I think that might be why it happened to him, but I don't know the reason."

Ko Ni had joined Information Minister Pe Myint on the visit to Muslim-majority Indonesia - billed as an opportunity to share experiences of national reconciliation. The delegation included several Myanmar Muslim leaders, some belonging to the mostly stateless Rohingya minority.

The United Nations special rapporteur on human rights in Myanmar, Yanghee Lee, met with Ko Ni on a visit to the country this month.

The independent expert said on Sunday evening that Suu Kyi "must get to the bottom" of Ko Ni's death.

"All responsible people must be brought to justice!," Lee wrote on Twitter.