Former President Barack Obama spoke to a crowd of young leaders in Johannesburg, South Africa, to mark the 100th anniversary of Nelson Mandela’s birth on Wednesday.

He encouraged women to become more involved politically, saying it would "lead to some better policies."

Obama also said men were getting on his "nerves," saying "we're violent; we're bullying."

Former President Barack Obama criticized his own gender as he encouraged more women to get involved in politics during a speech on Wednesday.

Obama was speaking to a group of young leaders in Johannesburg, South Africa, to mark the 100th anniversary of Nelson Mandela’s birth when he made the comments.

"Women, in particular, by the way, I want you to get more involved," Obama said to the crowd. "Men have been getting on my nerves lately."

He added: "Every day I read the newspaper, and I just keep thinking — brothers, what's wrong with you guys? What's wrong with us? We're violent; we're bullying.

"Just, you know, not handling our business. I think empowering more women on the continent is going to, right away, lead to some better policies."

Obama made the comments at Johannesburg Town Hall while speaking to members of the Leaders Africa program, which includes 200 young people from 44 African countries.

The former president also encouraged more young people to get involved in politics — but said they should get involved for the right reasons.

"The question is, 'how do I want to engage it?'" Obama said. 'You do not have an excuse to say this is too corrupt and I'm going to sell my soul. Find a way where you're not selling your soul.”"