A Pentagon agency has earmarked tens of millions of dollars for research into brain implants that could help fight mental disorders.

The Defense Advanced Research Projects Agency (DARPA) is launching the five-year program in the hope that it will find a new way to help military personnel with psychiatric disorders including depression, anxiety and post-traumatic stress disorder, NPR reported.

"We've seen far too many times where military personnel have neuropsychiatric disorders and there's very few options," Justin Sanchez, a DARPA rep, told NPR.

According to the Boston Globe, researchers at both the University of California San Francisco and Massachusetts General Hospital will be working on these brain implants. The UCSF researchers will reportedly receive $26 million for the project while the Boston researchers will get $30 million.

Both teams are working on a brain implant that will be ready for clinical trial some time in the next five years. The device will be designed so it can "read what is happening in the brain and stimulate multiple brain areas if abnormal activity is detected," the Globe reported.

According to a 2013 DARPA news release, about 100,000 people around the world already use brain stimulation devices to help them manage Parkinson's and dystonia. However, the implants that are currently used (known as "brain pacemakers") are relatively simple devices; DARPA said the research teams will be working on implants that are more responsive and sophisticated.

"While [the current brain stimulation] devices have been shown to be effective, they are very much built on concepts from the cardiac pacemaker industry," Sanchez told NPR. "And we know that the brain is very different than the heart."

DARPA said it hopes the project, which is part of President Barack Obama's BRAIN Initiative, will not only benefit members of the military, but will significantly enhance our understanding of mental illness.