The singer and Odd Future member was planning to publish the letter in the notes for new album Channel Orange, but posted it on his Tumblr after rumours began circulating.
Before posting the announcement, he said his "hope is that the babies born these days will inherit less of the bulls**t than we did".
"4 summers ago, I met somebody," he wrote. "I was 19 years old. He was too. We spent that summer, and the summer after, together. Everyday almost. And on the days we were together, time would glide. Most of the day I'd see him, and his smile.
"Sleep I would often share with him. By the time I realised I was in love, it was malignant. It was hopeless. There was no escaping, no negotiating to the women I had been with, the ones I cared for and thought I was in love with.
"I sat there and told my friend how I felt. I wept as the words left my mouth. I grieved for then. Knowing I could never take them back for myself. He patted my back. He said kind things. He did his best, but he wouldn't admit the same.
"He had to go back inside soon. It was late and his girlfriend was waiting for him upstairs. He wouldn't tell the truth about his feelings for me for another 3 years. I felt like I'd only imagined reciprocity for years.
"I kept up a peculiar friendship with him because I couldn't imagine keeping up my life without him. I struggled to master myself and my emotions. I wasn't always successful.
"I don't have any secrets I need kept anymore. There's probably some small s**t still, but you know what I mean. I was never alone, as much as it felt like it. As much as I still do sometimes. I never was. I don't think I ever could be. Thanks. To my first love, I'm grateful for you.
"Grateful that even though it wasn't what I hoped for and even though it was never enough, it was. Some things never are. And we were. I won't forget you. I won't forget the summer. I'll remember who I was when I met you. I'll remember who you were and how we've both changed and stayed the same.
"To my mother. You raised me strong. I know I'm only brave because you were first. So thank you. All of you. For everything good. I feel like a free man. If I listen closely, I can hear the sky falling too."
Odd Future member Tyler, the Creator later tweeted that he was "proud" of Ocean: "My Big Brother Finally F**king Did That. Proud Of That N***a Cause I Know That S**t Is Difficult Or Whatever. Anyway. Im A Toilet."
Watch Frank Ocean's video for 'Novacane' below: