Four climbers accused of repainting the Soviet star on one of Moscow's Stalinist skyscrapers in Ukrainian colours, and hanging a Ukrainian flag, are facing up to seven years in prison on charges of hooliganism.

A Moscow court has placed the two men and two women – Yevgeniya Korotkova, Anna Lepyoshkina, Alexander Pogrebov and Alexei Shirokozhukhov – under house arrest until 19 October. After originally opening the case on charges of vandalism, police on Thursday charged the four with hooliganism as well, the same statute under which three members of feminist punk group Pussy Riot were convicted in 2012.

But on Friday a Ukrainian roofer known as Mustang Wanted, whose videos of himself hanging from buildings at vertigo-inducing heights have earned him online notoriety, posted a photograph of himself standing on top of the repainted star and said he had coloured it and topped it with a Ukrainian flag "in an outburst of genuine patriotic feelings". He vouched for the four Russians' innocence and said he hadn't seen them on top of the building.

Muscovites woke on Wednesday to find that the huge yellow star atop the 577-foot building on the Kotelnicheskaya embankment, one of the famous Seven Sisters skyscrapers built in the Stalinist era shortly after the second world war, had been repainted. A Ukrainian flag planted on top of the star completed the effect.

The flag reportedly appeared at about 7:15am and remained for at least three hours before it was removed. One photograph circulated on Twitter showed a worker taking a "selfie" with the flag, apparently just before he set about removing it.

A police report said the vandals took the stairs to the top floor of the 32-storey residential building and then used climbing gear to ascend the spire. The four suspects were reportedly detained on Wednesday.

Pogrebov, a resident of Saint Petersburg, denied the four were guilty before a court hearing on Thursday. He said they were skydivers who climbed the building and did a simultaneous base jump from the roof below the spire that holds the star. "At the same time someone had coincidentally painted the star and hung the flag," Pogrebov said.

Ukrainian president Petro Poroshenko mentioned the action in a video on Wednesday inviting people to put out Ukrainian flags in the lead-up to the country's independence day on Sunday.

"I really liked that on the eve of the Ukrainian flag day they repainted a high-rise in Moscow in our colours," Poroshenko said. "I congratulate these Ukrainians."

While small pro-Ukrainian rallies have been held in Moscow, polls have shown the majority of Russians disapprove of the new government in Kiev and would support their government if an open war broke out between the countries. The West has accused Russia of sending men and arms to support rebels in eastern Ukraine.

But many in Moscow's chattering classes approved of the action's message and technique. Nadezhda Tolokonnikova, one of the convicted Pussy Riot members, tweeted a photo of the repainted star with the message: "They're heroes, of course."