The South African batsman replaces Sri Lanka captain Dimuth Karunaratne, who had previously signed for the Ageas Bowl outfit but is now unavailable because of international commitments.
Markram will arrive in time to feature in Hampshire’s County Championship division one curtain-raiser against Essex on Friday, April 5.
The 24-year-old will feature in both domestic red-ball and white-ball competitions until early May.
His availability following this period will then be determined by his involvement in South Africa’s World Cup campaign, with the opportunity for Karunaratne to return in his place should his playing commitments allow.
Predicted Portsmouth XI v Cheltenham: changes expected to side that beat Cardiff so handsomely - but attacking duo could keep places and defender set to return
League One latest: Oxford land former Pompey striker target from Swansea as Sheffield Wednesday bemoan exciting duo's move to Brentford and former Peterborough boss criticises club
Portsmouth boss Danny Cowley hails Spurs loanee Dane Scarlett as move already shows signs of putting Miguel Azeez's short stint from Arsenal in shade
Portsmouth loan strategy revealed following duo's arrival from Ipswich and Blackpool respectively
Portsmouth boss Danny Cowley spells out why Blues can rival Sheffield Wednesday, Ipswich and Derby for promotion as he prepares for welcome return to Cheltenham
Markram has been capped by the Proteas at both Test and one-day level.
The top-order batman has struck 1,358 Test runs at an average of 43.80 and became the first player in his club’s history to score two centuries in his first three matches.
And Markram is delighted to have moved to Hampshire.
He said: ‘I’m very excited to be joining Hampshire for the start of their season.
‘Hampshire have a great squad and I’m looking forward to working with the coaching staff and contributing to the goals of the team.
‘The Ageas Bowl and its facilities are brilliant and I have always wanted to go back after touring there with South Africa A so I am grateful for the opportunity.’
Hampshire director of cricket, Giles White, revealed Markram has been on his radar for some time.
He said: ‘We’re really pleased to have secured the signing of Aiden.
‘He’s certainly a player that we’ve kept a close eye on for the last couple of years and he’s had a great start to his international career in that time – he’s one of the best young talents in the world at this stage in terms of top-order batsman.
‘We start the season against a strong Essex team so it’s important to get him in as soon as possible and prepped for that fixture but we’re looking forward to having him with us to begin the season.’