Up until the 19th century, the word Bosniak (Bošnjak) came to refer to all inhabitants of Bosnia regardless of religious affiliation; terms such as "Boşnak milleti", "Boşnak kavmi", and "Boşnak taifesi" (all meaning, roughly, "the Bosnian people"), were used in the Ottoman Empire to describe Bosnians in an ethnic or "tribal" sense. After the Austro-Hungarian occupation of Bosnia and Herzegovina in 1878, the Austrian administration officially endorsed Bošnjaštvo ('Bosniakhood') as the basis of a multi-confessional Bosnian nation. The policy aspired to isolate Bosnia and Herzegovina from its irredentist neighbors (Orthodox Serbia, Catholic Croatia, and the Muslims of the Ottoman Empire) and to negate the concept of Croatian and Serbian nationhood which had already begun to take ground among Bosnia and Herzegovina's Catholic and Orthodox communities, respectively. Nevertheless, Bosnian nationhood was firmly established only among the Bosnian Muslims, while fiercely opposed by Serbs and Croats who were instead seeking to claim Bosnian Muslims as their own, a move that was rejected by most of them. After World War I, the Kingdom of Serbs, Croats and Slovenes (later "Kingdom of Yugoslavia") was formed and it recognized only those three nationalities in its constitution.
After World War II, in the Socialist Federal Republic of Yugoslavia, the Bosnian Muslims continued to be treated as a religious group instead of an ethnic one. Nevertheless, in a debate that went on during the 1960s, many Bosniak communist intellectuals argued that the Muslims of Bosnia and Herzegovina are in fact a distinct native Slavic people that should be recognized as a nation. In 1964, the Fourth Congress of the Bosnian Party assured the Bosniaks' the right to self-determination prompting the recognition of Bosnian Muslims as a distinct nation at a meeting of the Bosnian Central Committee in 1968, though not under the Bosniak or Bosnian name as opted by the Bosnian Muslim leadership. As a compromise, the Constitution of Yugoslavia was amended to list "Muslims" in a national sense; recognizing a constitutive nation, but not the Bosniak name. The use of Muslim as an ethnic denomination was criticized early on, however, on account of it disregarding Bosnian nationhood. To quote Bosnian president Hamdija Pozderac at the time:
They don't allow Bosnianhood but they offered Muslimhood. We shall accept their offer, although the name is wrong, but with it will start the process.
—In discussion with Josip Broz Tito in 1971 about constitutional changes which recognized "Muslims"
Sometimes other terms, such as Muslim with capital M were used (that is, "musliman" was a practicing Muslim while "Musliman" was a member of this nation; Serbo-Croatian uses capital letters for names of peoples but small for names of adherents).
After the dissolution of Yugoslavia in the early 1990s, the majority of these people, around two million, mostly located in Bosnia and Herzegovina and the region of Sandžak, declare as ethnic Bosniaks (Bošnjaci, sing. Bošnjak). On the other hand, some still use the old name Muslimani (Muslims), especially outside Bosnia and Herzegovina.
The election law of Bosnia and Herzegovina as well as the Constitution of Bosnia and Herzegovina, recognizes the results from 1991 population census as results referring to Bosniaks.
In Serbia, according to the 2011 census there were 22,301 Muslims by nationality and 145,278 Bosniaks.
In Montenegro census of 2011, 20,537 (3.3%) of the population have declared as Muslims by nationality, 53,605 (8.6%) have declared as Bosniaks, while 11,110 (1.79%) have declared as Montenegrins.
In 2002 Slovenia census, 21,542 persons identified as Bosniaks; 8,062 as Bosnians, while 10,467 chose Muslims by nationality.
In the Republic of Macedonia, the census of 2002 registered 17,018 (1,15%) Bosniaks and 2,553 (0.13%) Muslims by nationality. It is also important to note that most members of Pomaks and Torbeš ethnicities also declared as Muslims by nationality prior to 1990.