(CNN) Portugal's Salvador Sobral won the Eurovision Song Contest, the wildly popular annual competition that pits singers from nations in the European Broadcasting Union. The winning song, "Amar Pelos Dois" ("For The Both Of Us") was written by Sobral's sister, Luisa.

Sobral's win delighted fans gathered in the Ukrainian capital for Saturday's grand final, in which 26 acts took to the stage in a riot of costume and glitter.

When the judges announced the points for second place Bulgarian singer Kristian Kostov, and the teenager failed to get anough to overtake his Portuguese competitor, it slowly sunk in for Sobral that he had won.

"I thought this was crazy," he told reporters later.

The Sobrals' ballad, set to a jazz-like piano and soothing stringed instruments, gave Portugal its first win in the 61-year-old contest.

"If I can help to bring some change to music I will be really joyful. And part of this change is happening because of my sister," Sobral said, pointing to the simple poignancy of his sister's song.

Winner of #ESC2017 Salvador Sobral has a message for his fans and everyone who voted for him #Eurovision #CelebrateDiversity pic.twitter.com/V1PYDQAof8 — Eurovision (@Eurovision) May 13, 2017

Luisa joined her brother in a duet of the song immediately after the vote was announced. She also had filled in during some rehearsals for the finals because of her brother's serious health issues.

She said: "Our ears sometimes are so overwhelmed with everything that is happening (in music) that when someone comes and sings something very simple and very straight to you heart, it works 10 times more."

The Portugese singer won both the most points awarded by judges from each country in the contest and from residents of the nations taking part. He finished with 758 points, well clear of Kostov and the Moldovan entry, the Sunstroke Project.

"As long as people love me I will keep on doing music," Kostov, 17, said, according to a video posted on the competition's YouTube channel. He complimented the winner, saying, "He deserves (the) best. He was really good. ... He's doing nothing but he's doing everything."

Croatia's Jacques Houdek said he knew in his heart Sobral would win.

"I think it's a very beautiful song. ... It's very fado (a Portugese genre known for being plaintive). It's full of love. It's different," Houdek said.

This year the contest included people wearing a gorilla suit, a costume horse head, and a lighted full-face mask.

The song competition features singers from the 43 countries that make up the European Broadcasting Union (EBU.) This year's finalists were whittled down from a total of 42 entries through semifinals held Tuesday and Thursday.

Although the contest is supposed to be nonpolitical, this year's Eurovision saw its share of controversy. Russia should have been the 43rd entrant in the show, but pulled out last month amid a row over its chosen singer, Julia Samoylova.

Ukraine banned Samoylova from traveling to the capital of Kiev after allegations emerged she illegally entered Crimea to perform in 2015.

Ukranian law requires visitors to enter and exit Crimea -- annexed by Russia in 2014 -- with a special government permission since 2015, according to the Ministry of Foreign Affairs of Ukraine.

Eurovision organizers condemned Ukraine's decision to ban Samoylova but said Russian could instead take part in the competition via satellite or simply choose a different contestant who could legally travel to Ukraine.

However, Channel One, Russia's TV network, rejected both options and announced it would not broadcast this year's competition. Russian viewers were not able to vote in the contest either.

Eurovision Song Contest winner 2016 Jamala, representing Ukraine, is seen on stage with her award.

But Ukraine was determined to host as expected and organizers announced earlier this month that all the tickets for the grand final had sold out.

Heavy security is in place in Kiev for the event in the city's International Exhibition Center.

One dignitary, however, wasn't present. Ukrainian President Petro Poroshenko canceled his visit to the final after deadly shelling in the east of the country Saturday, according to his official Facebook account. Four civilians were killed and one seriously wounded by shelling in the town of Avdiivka on Saturday evening, the country's Anti-Terrorist Operation press center said.

Some have remarked that the Eurovision Village, where visiting fans gathered to watch the shows live on big screens, is in central Khreshchatyk Street and Independence Square, scene of bloody protests little more than three years ago.

But the contest's many fans, some so dedicated that they travel each year to the host city, were ready for the big finale.

The wait is over! Tonight is THE night!

Happy #Eurovision Day! pic.twitter.com/2rBrCujFkr — Aurelyan Eurovision (@AurelyanESC) May 13, 2017

"I'm very proud that Ukraine has hosted the Eurovision Song Contest at such a high level," Zhenia Halych, lead artist of the Ukrainian band O.Torvald, told a Eurovision news conference Friday.

How it works

Latvia's contestants react as they go through to the final from the semi-final in Kiev on May 9.

Eurovision is known for its theatrical production, unique songs and fervent patriotism. Songs must be performed live, be no longer than three minutes and can be sung in any language.

Viewers of participating broadcasters can vote for their favorite song but not for their own country. The votes can be cast via telephone, SMS or using the official app. There is also a jury of professionals in each nation to award points.

Block voting, nationalism and a settling of old scores have long been accusations when it comes to Eurovision. For many viewers, watching the votes come in as expected from certain nations just adds to the fun.

US viewers were able to watch the grand final streamed live via Logo , but were not allowed to cast votes.

What you need to know

The first Eurovision contest was held in 1956, when just seven countries took part. That six-decade run makes it one of the longest-running TV shows in the world. Last year, 204 million people watched at least some part of the contest from around the world.

Six countries are always guaranteed a spot in the final -- the host nation and France, Germany, Spain, Italy and the United Kingdom, because they pay the most money toward the cost of the competition. Since 2015, Australia has been among the contestants. Other non-European entrants include Israel and Azerbaijan.

By the time the curtain fell on the 2017 contest, 1,479 songs in total were performed, according to Eurovision.

Ireland has done best over the decades, winning seven times. Sweden has won the contest six times, while Luxembourg, France and the United Kingdom have won five times.

Victory comes at a cost, however. The winning nation must host the contest the following year, which doesn't come cheap.