Spain's government is preparing to block an agreement among NATO countries to raise defence spending to 5% of GDP just days out from a major summit, Spanish media has reported.

NATO Secretary General Mark Rutte is pushing for members of the transatlantic security bloc to boost their defence spending to 5% GDP by 2032, after US President Donald Trump declared America's allies were shirking their responsibilities.

The proposal stipulates that 3.5% of GDP should be earmarked for core military spending with a further 1.5% dedicated to broader security-related areas such as infrastructure.

US Defence Secretary Pete Hegseth said he expected the agreement to be sealed at next week's NATO summit, set to be held in the Netherlands on June 24-25.

'We are very close, almost near consensus, on a five per cent commitment for NATO in The Hague later this month,' Hegseth said after a recent meeting with his NATO counterparts in Brussels.