Saying they turned on us is misleading. They were never on our side, but Hitler was the bigger threat.
The US nuked Japan post surrender (go look it up - the documents were declassified a decade ago) as a bluff to convince the Russians that they could not win a war where they attempted to take all of Europe.