Ahmad Yani was born in Jenar, Purworejo, Central Java on 19 June 1922 to the Wongsoredjo family, a family that worked at a sugar factory run by a Dutch owner. In 1927, Yani moved with his family to Batavia, where his father now worked for a Dutch General. At Batavia, Yani worked his way through primary and secondary education. In 1940, Yani left high school to undergo compulsory military service in the Army of the Dutch East Indies colonial government. He initially trained to be a Navy Seaman. He studied military topography in Malang, East Java, but this education was interrupted by the arrival of the invading Japanese in 1942. At the same time, Yani and his family moved back to Central Java.
In 1943, he joined the Japanese sponsored Peta (Defenders of the Motherland) army, and underwent further training in Magelang as an Artillery officer. After completing this training, Yani enlisted to be trained as a Peta platoon commander and was transferred to Bogor, West Java to receive his training. Upon completion, he was sent back to Magelang as an instructor.
After Independence Yani joined the army of the fledgling republic and fought against the Dutch. During the first months after the Declaration of Independence, Yani formed a battalion with himself as Commander and led it to victory against the British at Magelang. Yani then followed this up by successfully defending Magelang against the Dutch when it tried to take over the city, earning him the nickname of the "Savior of Magelang". Another notable highlight of Yani's career during this time period was the series of guerilla offensives he launched in early 1949 to distract the Dutch whilst Lieutenant Colonel Suharto prepared for the 1 March General Offensive which was to be directed at Yogyakarta.
After Indonesia's Independence was recognized by the Dutch, Yani was transferred to Tegal, Central Java. In 1952, he was called back into action to fight the Darul Islam, a group of rebels seeking to establish a theocracy in Indonesia. To deal with this rebel group, Yani formed a special forces group called the Banteng Raiders. The decision to call in Yani paid dividends and over the next 3 years, Darul Islam forces in Central Java suffered one defeat after another.
In December 1955, Yani left for the United States to study at the Command and General staff College, Fort Leavenworth, Kansas. Returning in 1956, Yani was transferred to the Army Headquarters in Jakarta where he became a staff member for General Abdul Haris Nasution. At the Army Headquarters, Yani served as Logistics Assistant to the Army Chief of Staff before becoming Deputy Army Chief of Staff for Organization and Personnel.
In August 1958, he commanded Operation August 17 against the Revolutionary Government of the Republic of Indonesia rebels in West Sumatra. His troops managed to recapture Padang and Bukittinggi, and this success led to his being promoted to 2nd deputy Army chief of staff on 1 September 1962, and then Army chief of staff on 13 November 1963 (automatically becoming a member of the cabinet), replacing General Nasution.
As President Sukarno moved closer to the Indonesian Communist Party (PKI) in the early 60s, Yani, who was strongly anti-communist, became very wary of the PKI, especially after the party declared its support for the establishment of a fifth force (in addition to the four armed services and the police) and Sukarno tried to impose his Nasakom (Nationalism-Religion-Communism) doctrine on the military. Both Yani and Nasution procrastinated when ordered by Sukarno on 31 May 1965 to prepare plans to arm the people.
In the early hours of 1 October 1965, the 30 September Movement attempted to kidnap seven members of the Army general staff. A squad of about 200 men surrounded Yani's home at Latuhahary Street No. 6 in the Jakarta suburb of Menteng. Usually Yani had eleven troops guarding his home. His wife later reported that a week before an additional six men were assigned to him. These men were from the command of Colonel Latief, who unknown to Yani, was one of the main plotters in the 30 September Movement. According to Yani's wife, the additional men did not appear for duty on that night. Yani and his children were asleep in his house while his wife was out celebrating her birthday by staying out with a group of friends and relatives. She later recounted that as she drove away from the home at about 11pm, she noticed someone sitting in the shadows across the street as if keeping the house under observation. She thought nothing of it at the time, but following the events later that morning she wondered differently. Also, from about 9 pm on the evening of 30 September a number of phone calls were made to the house at intervals, which when answered would be met with silence or a voice would ask what time it was. The calls continued until about 1 am and Mrs Yani said she had a premonition something was wrong that night.
Yani spent the evening with official callers; at 7 pm he received a colonel from KOTI, the Supreme Operations Command. General Basuki Rahmat, divisional commander in East Java, then arrived from his headquarters in Surabaya. Basuki had come to Jakarta to report to Yani on his concerns about increasing communist activity in East Java. Complimenting his report, Yani asked him to accompany him to his meeting the following morning with the President to relay his account.
When the kidnappers came to Yani's home and told him that he was to be brought before the president, he asked for time to bathe and change his clothes. When this was refused he became angry, slapped one of the kidnapper soldiers, and tried to shut the front door of his house. One of the kidnappers then opened fire, killing the general. His body was taken to Lubang Buaya on the outskirts of Jakarta and, together with those of the other murdered generals, was hidden in a disused well.
Yani's body, and those of the other victims, was disinterred on 4 October, and all were given a state funeral the next day, before being buried at the Hero's Cemetery at Kalibata. On the same day, Yani and his colleagues were officially declared Heroes of the Revolution by Presidential Decision No. 111/KOTI/1965 and his rank was raised posthumously from Lieutenant General to a 4-star General (Indonesian: Jenderal Anumerta).
Mrs Yani and her children moved out of the home after Yani's death. Mrs Yani helped make their former home into a public museum which stands largely as it was in October 1965, including bullet holes in the door and walls, and with the home's furnishings of the time. Today, many Indonesian cities have roads named after Yani, and Semarang's Achmad Yani International Airport is named after him.