Borislav Pekić spent his childhood in different cities of Serbia, Montenegro and Croatia. He graduated from high school in 1945 in Belgrade and shortly afterwards was arrested with the accusation of belonging to the secret association "Yugoslav Democratic Youth" and sentenced to fifteen years of prison. During the time in prison he conceived many of the ideas later developed in his major novels. He was released after five years and in 1953 began studying experimental psychology at the University of Belgrade Faculty of Philosophy, although he never earned a degree.
In 1958 he married Ljiljana Glišić, the niece of Milan Stojadinović, Prime Minister of Yugoslavia (1935–1939) and a year later their daughter Aleksandra was born. 1958 marked also the year when Pekić wrote his first of over twenty original film scripts for the major film studios in Yugoslavia, among which Dan četrnaesti ("The Fourteenth Day") represented Yugoslavia at the 1961 Cannes Film Festival.
For years Pekić had been working on several novels and when the first of them, Vreme čuda (1965), came out, it caught the attention of a wide reading audience as well as the critics. In 1976 it was published in English by Brace Harcourt in New York as The Time of Miracles. It was also translated into French in 1986, Polish in 1986, Romanian in 1987, Italian in 2004, and Greek in 2007. Pekić's first novel clearly announced two of the most important characteristics of his work: sharp anti-dogmatism and constant scepticism regarding any possible 'progress' mankind has achieved over the course of history.
During the 1968–1969 period, Pekić was one of the editors of Književne novine literary magazine. In 1970 his second novel, Hodočašće Arsenija Njegovana (The Pilgrimage of Arsenije Njegovan) was published, in which an echo of the students protests of 1968 in Yugoslavia can be found. Despite his ideological distance from the mainstream opposition movements, the new political climate further complicated his relationship with the authorities, who refused him a passport for some time. The novel, nevertheless, won the NIN award for the best Yugoslav novel of the year. An English translation The Houses of Belgrade appeared in 1978 and it was later published in Polish, Czech and Romanian.