The prime minister announced the UK will reallocate aid funds to boost military spending to 2.5% of GDP by 2027.