Perhaps it was trying to make sure it was in a good position for the fireworks.

Police officers patrolling New York city’s harbour have posted images of a whale they spotted in the East River.

The New York Police Department's special operations division posted a photo of the tourist on its Twitter account Saturday morning, as the city readied itself for a traditional New Year’s Eve celebration with fireworks and lights.

The Associated Press said the whale was seen swimming along the shores of Manhattan's upper East Side, close to Gracie Mansion, where the mayor lives.

US Coast Guard Petty Officer Frank Iannazzo-Simmons said that while officials from his office had not seen the whale, based on the photos it appeared to be a humpback whale.

One such humpback whale was also spotted in the East River last month.

Mr Iannazzo-Simmons said the Coast Guard usually notifies mariners when it spots whales in busy waterways to be safe and “let the whale be the whale”.

Last month there were three separate humpback whale sightings in the Hudson River, although it is unclear if they were of the same creature.