Psychedelic medicine is having a moment.

Just weeks after the U.S. Food and Drug Administration approved approved Johnson & Johnson's ketamine-like nasal spray for depression, a group of European technology investors just got together for the largest-ever private financing round for a psychedelic medicine biotech company, ATAI.

Psychedelic medicine involves research and investigations into mind-altering substances to treat mental illnesses including addiction, depression and post-traumatic stress disorder. After recreational use of psychedelics became popular in the 1960s, the U.S. government classified most of them "drugs of abuse" with no real medical value. However, recent clinical studies show mounting evidence that some psychedelics can help patients with certain mental illnesses, either in combination with traditional therapies or in cases where nothing else has worked.

Now health and technology investors are paying attention.

German company ATAI Life Sciences announced on Tuesday that it has raised more than $40 million in new financing. The round valued the company at $240 million, according to a person familiar, making it both the biggest round and the most valuable company in the young space. (There are well established nonprofits, like MAPS in California, but relatively few for-profit ventures.) ATAI is also targeting a potential initial public offering for the end of this year, the person said, which would draw further attention.

ATAI is currently funding clinical trials for what it refers to as "formerly stigmatized compounds," including psilocybin, the active compound in psychedelic mushrooms, and arketamine, a different variant of ketamine from the one Johnson & Johnson researched, as potential treatments for depression. Its portfolio also includes a technology arm called Innoplexus, which it describes as delivering "big data and AI solutions" to big pharma and biotech companies, as well as its own drug development.

ATAI is also the largest investor in a start-up called Compass Pathways, which is setting itself up to be the first legal provider of psilocybin. ATAI invested alongside Peter Thiel, the iconoclastic Silicon Valley investor and Facebook board member who's increasingly dabbling in health and biotech. ATAI co-founders Lars Wilde and Florian Brand are both affiliated with Compass; a third founder, Christian Angermayer, is a German entrepreneur and investor.