Eli Lilly NYSE:LLY agreed to buy psychedelic drugmaker AtaiBeckley for up to $3.8 billion, sending the target's shares sharply higher in premarket trading.

Lilly will pay $6.75 per share in cash, valuing AtaiBeckley at about $2.8 billion upfront. Investors could receive another $2.50 per share, or roughly $1 billion, through contingent value rights tied to clinical and regulatory milestones.

AtaiBeckley develops psychedelic-based treatments for mental health disorders. Its lead program, BPL-003, is an intranasal form of 5-MeO-DMT being tested for treatment-resistant depression.

The deal strengthens Lilly's neuroscience pipeline and gives it exposure to a fast-growing but still risky corner of mental-health drug development. AtaiBeckley shares jumped about 31% before the bell after surging 66% after hours, while Lilly traded little changed.