The aim is to see whether "directed energy" technology could benefit the armed forces, and is to culminate in a demonstration of the system in 2019.
The contract was picked up by a consortium of European defence firms.
The prototype will be assessed on how it picks up and tracks targets at different distances and in varied weather conditions over land and water.
Peter Cooper, from the UK's Defence Science and Technology Laboratory (DSTL), headquartered at Porton Down, Wiltshire, said the project "draws on innovative research into high power lasers so as to understand the potential of the technology".
He added that this could "provide a more effective response to the emerging threats that could be faced by UK armed forces".
The MoD has been finalising the agreement with the consortium, called UK Dragonfire, for several months, but it has now formally announced them as the winning contractor.