It has not been disclosed how many games 24-year-old O'Neil, who joined Pompey as a schoolboy, must play to activate the full payment.
But agent John Mac told Portsmouth News: "Things had to be restructured between the clubs, but it didn't mean Middlesbrough paying less than £5million for him. In fact they will end up paying slightly more on appearances.
"If they had offered less than £5million Gary would have been sent back - simple as that. There is no way he would have gone for less than £5million because Pompey had three other clubs prepared to pay that amount."