Two Russian brothers were charged Sunday in the bizarre shooting at a fancy wedding party at the famed Waldorf Astoria hotel over the weekend.

The lavish affair turned bloody Saturday evening when Vladimir Gotlibovsky’s gun accidentally went off and the bullet grazed the head of a female guest, officials said.

Three other guests were struck in their legs by flying marble, tile and glass from the ricocheting bullet, authorities said.

No one was seriously hurt.

Gotlibovsky, 42, of Mill Basin was charged with reckless endangerment, assault and tampering with physical evidence.

He claimed to have a proper permit for the weapon, but sources said cops were still investigating.

After the gun discharged, Gotlibovsky handed it off his brother, Felix Gotlibovsky, 51, who gave it to his wife and stored it at their house, authorities said Sunday.

Law-enforcement sources said investigators had to obtain a search warrant to get the gun.

Felix was charged with weapon possession and tampering with physical evidence.

The guests had been snapping photos in their suits and party dresses in the internationally famed Midtown hotel at 7 p.m. when the mayhem began, a law-enforcement source told The Post.

The gun allegedly belonging to Vladimir Gotlibovsky discharged in his pocket. The bullet blasted a gaping hole with burnt edges in his pants before the gun fell to the ground.

Gotlibovsky was unscathed, but the slug ricochetted and grazed the head of Maya Rafailovich, 55, of Brighton Beach.

She was wheeled out of the hotel on a gurney, shoeless and with orange straps criss-crossing her black cocktail dress. A white bandage covered her forehead.

Her eyes were open — and angry — as she was rolled into a Bellevue Hospital-bound ambulance.

The other injured guests, a 59-year-old man and two women, 38 and 45, suffered minor leg wounds and were taken to Bellevue and Roosevelt hospitals.

Vladimir Gotlibovsky, rear-cuffed and still wearing his dark suit and blue tie, was taken into custody for questioning after the fiasco.

“I didn’t do anything,’’ he said as he was led into the Midtown North precinct.

Two other people — presumably witnesses — were also taken there.

“We have various video and evidence that we are looking at to further the investigation,” Chief William Aubry told reporters Saturday night.

The gunfire set tongues wagging outside the ritzy hotel.

“The police came out with a balding husky guy wearing a suit,’’ said tourist Tina Fallis of Canada.

“It’s like something like you see on ‘CSI,’” she said, adding she didn’t expect that kind of violence in such a “prestigious’’ hotel.

Rafailovich’s daughter, who asked that her name not be printed, told The Post, “She’s in the hospital. I’m on my way there. They’re doing MRIs and X-Rays.’’