The 26-year-old left-back was a free agent having left Brighton at the end of last season.
He told Pompey's website: "I'm used to life down on the south coast and I'm excited to be joining a great club like Pompey, who have such a fantastic fanbase.
"This club is an attractive proposition whatever league they're in. There's a lot of work to be done and it's up to the players to take Pompey back up.
"I enjoy defending and hopefully I'll be able to use my experience to help the team do well this season."
Painter could make his debut against Morecambe at Fratton Park on Saturday.
Manager Guy Whittingham said: "Marcos is an experienced player who has competed at a high level. He's a good out-and-out defender and we're pleased he's come here.
"I think he was impressed with the vision of what we want to achieve here, while we were impressed with his attitude."
- Sports & Recreation