The A136-D934 goes over the Col du Portalet. Not a particularly tough climb, but the col is at 1,794 m and the climb is almost 30km long from the French side.
The Quebrantahuesos sportive goes over there, done it twice now. Lovely ride, that’s a long climb though if you’re not used to it!
There might be a bored looking Guardia Civil or Gendarme at the top, but I doubt it. If you enter Spain you need to be carrying your passport anyway, but it’s very unlikely you’ll be stopped at the border.
Edit: incidentally, the 40km descent from Somport to Escot is superb, particularly the first 10km or so. Very fast, beautiful scenery, and lots of fun. Well worth doing.