LeBron James defended Long Island’s Danny Green of the Spurs on the perception he partied with the Heat in South Beach after Miami beat San Antonio late Thursday night for the NBA championship.

A picture that raced around the web Friday showed James giving Green a hug at the exclusive South Beach nightclub, LIV, at the Fountainbleau Hotel, where the Heat were celebrating in the wee hours.

Green and James were teammates in Cleveland during the 2009-10 season. Green told The Post they were good friends as Cavaliers. Dwyane Wade and James reportedly didn’t show up at the club until 3 a.m. Friday

James, who rarely tweets, wrote on his Twitter account yesterday:

“Danny Green did not party with us on Thursday night. He came to say congrats and I told him how proud of him I was for taking full advantage of the opportunity he was given and keep going. We dapped up, showed love and he left. #StopBelievingAllYouHear’’

Asked after Game 5 by The Post if he and James were talking during the series, Green said, “There’s no friendly chitchat during the [NBA] Finals.’’