A washed-up whale carcass lured sharks and hundreds of fascinated onlookers to City Beach on Monday and is now proving a giant headache for authorities working out how to remove its remains.

The 13m humpback whale became stranded at 7.30am and quickly attracted great white sharks into the shallows at South City Beach.

“There was two, and they came up and tried to have a go,” beachgoer Lydia Moss said. “They’re bigger than I thought they were going to be, they look big, massive.”

City Beach and others along the coast were closed as a precaution, with people urged to stay out of the water.

But those who came to have a look from the sand had no issue spotting the feasting sharks amid the foul stench of the decaying whale.

Sharks at City Beach after a whale carcus washed ashore.Camera IconSharks at City Beach after a whale carcus washed ashore. Credit: 7NEWS/7NEWS

The SharkSmart website identified several sharks in the area throughout the day, including a 5m monster just 10m from shore, about 8.30am.

Another 4m great white was spotted at 10.46am, while there were also reports of smaller sharks.

The sight of sharks so close to shore and police boats in the water provided a terrible reminder of the horror at Sorrento Beach 10 days ago, when swimmer Greg O’Neill, 63, was taken by a great white.

Onlooker Sophie Wormald said the shark activity in the shallows would only feed people’s anxieties about swimming.

“It’s going to be unusual summer at the beach. I think people are a little bit worried, and this is not going to help,” she said.

Whale Watch Western Australia owner Gemma Sharp said one of her tours had seen the dead mammal about 7.5km off the coast of Scarborough Beach on Sunday afternoon. She was disappointed the whale — which she described as “young” — was not taken out to sea.

“If you tow it a fair way off, then the carcass will sink, and that keeps the sharks happy and keeps them off the coast,” she said.

The whale carcuss is proving to be a problem for local authorities.Camera IconThe whale carcuss is proving to be a problem for local authorities. Credit: 7NEWS/7NEWS

“Sharks will linger in the area for as long as that scent remains, and if (the whale) is sitting on the beach, the scent will settle into that area.

“It doesn’t just disappear when the whale goes.”

Removing the remains — weighing about 31 tonnes — will be no mean feat.

Authorities were still working through the location for its final resting place — likely a landfill facility at Baldivis or Red Hill.

“This is a complex and potentially hazardous operation involving a very large carcass, heavy machinery and specialist personnel, and we need to ensure we can do this safely before work begins,” Cambridge mayor Gary Mack said.

“Our focus is on removing the carcass intact as much as possible, at the earliest safe opportunity.”

He said public safety would determine when City Beach reopens, but it could be several days.

“Wild carcasses attract sharks, and people nor their pets should actually go into the water at all while the beach is closed and should look after their personal safety,” Mr Mack said.

Summer life saving patrols are due to start this Thursday.