Kenya will become the first country in Africa to collect data on intersex people in its national population census, in a major victory for rights activists.
The August survey will determine the number of citizens who do not identify as either male or female.
Intersex people in Kenya often face violence and discrimination.
There are thought to be more than 700,000 of them out of a general population of 49 million.
"Getting information about intersex people in the census will help people understand the challenges we go through," Mr Ryan Muiruri, founder of the Intersex Persons Society of Kenya (IPSK), said he welcomed the government's decision.
"Being included in the census is a big achievement for us," he told the BBC.
South Africa was the first African country to explicitly include intersex people in anti-discrimination law.
What is the background?
In 2009, a woman in Kenya went to court after doctors wrote a question mark instead of a gender on her child's birth papers.
He wanted three things: identity documents for her child to be able to attend school, a law preventing surgery on intersex children unless it is medically necessary, and proper information and psychological support for parents.
In a landmark ruling in 2014, the High Court ordered the government to issue a birth certificate to the five-year-old child.
In addition, it ordered the attorney general to create a task force that would look at ways of providing better support for intersex children.
That task force handed its recommendations to the Attorney General in April. They include delaying surgery until children can choose for themselves and a robust survey on numbers.
It also recommended that an I-marker, an intersex identifier, be used in public documentation.