score:2
If your D visa is still valid, then you can exit and re-enter the Schengen Area through Spain.
While it says it's only valid for one country (I really don't know why - it's stupid), since a couple of years they've been equal to residence permits in normal cases, permitting entry and exit to/from the Area through any member state.