BANGOR, Maine — Egyptian native Yasser Darwish was familiar with Afro-Brazilian martial art of Capoeira Luanda, but he never shared a stage with its practitioners — until he came to the American Folk Festival. Neither had the members of Quebecois trio Bon Debarras.

On Saturday afternoon, the members of these three very different groups talked about and demonstrated their individual art, then wound up dancing with each other to a rhythm that blended the music of three continents: South America, Africa and North America.

Bringing together performers who, on the face of it, share no musical heritage and discovering their roots systems are intertwined has been a goal of the festival since it first came to town as the National Folk Festival in 2002.

“Africa is the musical base for every culture,” Jelon Vierra, founder of Capoeira Luanda, based in New York City, said after the Saturday afternoon session. “We were conceived in one place — Africa — but we grew up in different areas. And now we come together in this place.”

Capoeira has been practiced in Vierra’s native Brazil since the 15th century, he told the audience. A form of martial arts, its moves were accompanied by music. Vierra said it was disguised as dance so the African slaves could hide its purpose from their Portuguese-speaking masters in Brazil.

The berimbau, a stringed instrument that can be made with different sizes of dried gourds, is the main instrument that has been used in capoeira. It simulates the rhythm, the style and the speed of the movement, he said. When fighting threatens to get out of hand, for example, reducing the tempo with the berimbau tells participants to slow down. Drums and tambourines also are played.

Capoeira, with its quick and complex moves, high kicks, spins, splits and flips, can look more like gymnastics than taekwondo or karate. The difference is that the music is an integral part of the art.

Garrett Boardway, 32, of Bangor was the artist buddy assigned to escort the members of Capoeira Luanda during the festival. He is part of a local group studying capoeira.

“I’m learning more about the art and a lot about performance,” he said Saturday afternoon. “But I’ve also found out that it doesn’t matter if you’re from Bangor, New York or Brazil — capoeira is one family.”

Darwish is a master of Tanoura, or the whirling dervish dance — a style inspired by a meditation associated with the mystical religious order of Sufism. Musicians accompanied his performances on traditional instruments and improvised with the capoeira players while Darwish twirled and ducked in response to the performers’ high kicks.

Dominic Desrochers, guitarist, singer and percussive dancer with Bon Debarras based in Montreal, Quebec, added the sounds of step dancing to the capoeira beat.

The program highlighting dance traditions reminded this year’s audience that when cultures collide on the Bangor Waterfront, harmony ensues.