He flipped for her — and died of a broken heart.

Peter the Dolphin was just 6 years old when he fell in love — with a human. The bottlenose dolphin met research assistant Margaret Howe just as the free love movement was emerging in 1965.

Howe was supposed to spend 10 weeks teaching Peter English words, but Peter was more focused on getting to know his teacher in a different way.

As he was “sexually coming of age,” Howe said, Peter turned hot for his teacher, and fell in love. Howe and Peter’s star-crossed love story is the focus of a new BBC documentary, “The Girl Who Talked to Dolphins,” set to air next week, according to the Daily Mail.

Howe and Peter did everything together — eating, sleeping, bathing and playing — as part of a NASA experiment that aimed to teach Peter to speak through his blowhole.

The experiment, which plays out like a real-life version of the famous 1973 film “Day of the Dolphin,” had a unique set-up. Dr. John C. Lilly, the experiment’s leader, flooded a sun-drenched remote location in St. Thomas with seawater 22 inches deep. Howe had a desk suspended from the ceiling and a hanging mattress protected by a shower curtain, which Peter loved to splash water at for attention.

Howe’s lessons started immediately, but Peter quickly proved to be a bad boy. She tried hard to get Peter to greet her in the morning by saying, “Hello Margaret,” but he had trouble with the letter “M.” Instead, Peter had something else to greet her with.

About four weeks into the experiment, Howe wrote in her diary: “Peter has become sexually aroused several times during the week.”

“I find that his desires are hindering our relationship,” she wrote. “He jams himself again and again against my legs, circles around me, is inclined to nibble and is generally so excited he cannot control his attitude around me.”

Peter may not have been the only one smitten, though. “That relationship of having to be together sort of turned into really enjoying being together, and wanting to be together, and missing him when he wasn’t there,” Howe admitted.

“I did have a very close encounter with — I can’t even say ‘a dolphin’ again — Peter.”

In the trailer for the documentary, Howe explains that she would masturbate Peter to keep him focused, otherwise he did not pay attention to her lessons.

“It was just easier to incorporate that and let it happen. It was very precious, it was very gentle. Peter knew I was right there, Peter was right there … again it was sexual on his part, it was not sexual on mine — sensuous perhaps,” she said.

“It would just become part of what was going on, like an itch, just get rid of that, scratch it and we’ll be done and move on.”

After the experiment ended and the lab was closed, Peter was shipped back to Lilly’s lab in Miami and his health quickly deteriorated.

A few weeks later, Peter committed suicide, with veterinarian Andy Williamson ruling his cause of death a broken heart.

“Margaret could rationalize it, but when she left, could Peter?” Williamson said. “Here’s the love of his life gone.”