Officers were called by the ambulance service to a report that a girl had become unwell at an address in Scarborough at about 4pm on Wednesday.
They found girls aged 13 and 14 at the property in the North Marine Road area and both were taken to hospital.
North Yorkshire Police said the older girl was pronounced dead a short time later at hospital.
The 13-year-old remained in hospital and her condition was not believed to be life-threatening.
Two teenage boys were arrested by police on suspicion of offences involving the supply of Class A drugs.
One was released under investigation while the other remained in custody.
Detective Chief Inspector Graeme Wright, of North Yorkshire Police, said: "First and foremost, our thoughts are with the family and friends of the young girl who died as a result of this tragic event, and of all those affected by it.
"Extensive police enquiries are ongoing to determine the events around her death.
"Although our investigation is at an early stage, I would urge anyone who has acquired MDMA or other illegal drugs recently not to take them.
"If you have taken such a drug and feel unwell, it is vital that you seek medical help immediately.
"This is clearly a devastating incident and I would ask everyone to respect the privacy of the families involved, and refrain from speculating about this incident online."
Anyone with information is asked to call 101.
A message from the Editor
Thank you for reading this story on our website. While I have your attention, I also have an important request to make of you.
With the coronavirus lockdown having a major impact on many of our advertisers - and consequently the revenue we receive - we are more reliant than ever on you taking out a digital subscription.
Subscribe to scotsman.com and enjoy unlimited access to Scottish news and information online and on our app. With a digital subscription, you can read more than 5 articles, see fewer ads, enjoy faster load times, and get access to exclusive newsletters and content. Visit https://www.scotsman.com/subscriptions now to sign up.
Our journalism costs money and we rely on advertising, print and digital revenues to help to support them. By supporting us, we are able to support you in providing trusted, fact-checked content for this website.