Pre-Sultanate era
According to the mythology of the Maanyan people (the oldest ethnic group in South Kalimantan), the first kingdom in southern Kalimantan was the Nan Sarunai Kingdom which was estimated to have territory ranging from Tabalong to Paser. The Maanyan mythology tells of the golden age of the Nan Sarunai Kingdom, uniting the Maanyan people and made connections with the island of Madagascar off the coast of Africa. One of the archaeological remains from this era is the Great Temple located in the town of Amuntai. In 1996, C-14 testing of charcoal samples from the Agung Temple dated the structure between 242 and 226 BC. Judging from the number of years referred, the Kingdom of Nan Saruna was 600 years older than the Kutai Martapura Kingdom in East Kalimantan. According to Hikayat Sang Bima, the people who brought descended into the kings of Banjar were the gods that also descended into the kings of Bima, Bali, Dompu and Gowa who is the five sons of Maharaja Pandu Dewata.
The Malagasy language in Madagascar is similar to the Banjar language. Francois-Xavier Ricaut has shown that the Malagasy people's genetic makeup is 68 percent of Africans and 32 percent of Asians. Based on their evidence, Banjar is the Asian group that is most likely to have traveled to Madagascar. Genetic dating supports the hypothesis that Austronesian migration occurred about 1,000 years ago, while the last significant Bantu migration to Madagascar began 300 years later, after climatic change in Africa. Language shifts are thought to have occurred in Southeast Kalimantan after the Banjar migration to Madagascar. It is estimated that the Banjar people, who currently speak Malay, may speak a language closer to the language reconstructed for Proto-Malagasy. This linguistic change follow the main cultural and genetic mix with Malays, driven by the trade post of the Malay Empires in Southeast Kalimantan. The collapse of the Malay Empires during the 15th and 16th centuries coincide with the end of the mixture of Malay genes into the Banjar population. Genetically, ancient Banjar tribes has a mixture of ancient Malay Dayak and Maanyan ancestry. The Banjar tribes, which had dominant Malay genetics, migrated out of Borneo around 830 AD or 1,200 years ago to what is now known as Madagascar.
The Nan Sarunai kingdom was invaded by the Majapahit multiple times, with the third and last invasion under the reign of Hayam Wuruk in 1355. At the time Nan Sarunai was led by Raden Anyan or Datu Tatuyan Wulau Miharaja Papangkat Amas. This invasion was led by Ampu Jatmika with his entourage which according to Hikayat Banjar included his advisor Aria Megatsari, general Tumenggung Tatah Jiwa, minister Wiramartas, punokawan Patih Baras, Patih Basi, Patih Luhu, dan Patih Dulu, and bodyguards Sang Panimba Segara, Sang Pembelah Batung, Sang Jampang Sasak, and Sang Pengeruntung 'Garuntung' Manau. Multiple battles happened with the first battle in April 1358; killed Majapahit soldiers were burned in Tambak Wasi. Nansarunai admiral Jamuhala was also killed in this battle. While prince Jarang and prince Idong hid in Man near the Tabalong-kiwa river. Nansarunai soldiers regrouped in Pulau Kadap before the second battle occurred in December 1362. Casualties from this second battle were buried in Tambak in Bayu Hinrang. In this battle Raden Anyan was killed, speared by Mpu Nala, and buried in Banua Lawas. In its place, Ampu Jatmika founded a Hindu kingdom, Negara Dipa under Majapahit tributary, predecessor of Negara Daha and Banjar Sultanate. Its remnants include Candi Agung complex of Amuntai constructed by Ampu Jatmika on an older Ma'anyan site. While surviving Javanese, Dayak, Madurese, and Bugis soldiers, sailors, metalsmiths of the war settled in Amuntai, Alabio, and Nagara. These invasions were recorded in Dayak Ma'anyan poetry as Nansarunai Usak Jawa.
Maharaja Sukarama, the King of Negara Daha, had the intention that his successor would be his grandson Raden Samudera, son of his daughter Puteri Galuh Intan Sari. The father of Raden Samudera was Raden Manteri Jaya, son of Raden Begawan, brother of Maharaja Sukarama. The will caused Raden Samudera to be threatened with safety because the sons of Maharaja Sukarama were ambitious as kings, namely Prince Bagalung, Prince Mangkubumi and Prince Tumenggung. Assisted by Arya Taranggana, Raden Samudra fled by boat to the lower Barito river. After Sukarama's death, Prince Mangkubumi became King of the Negara Daha, then succeeded by Prince Tumenggung who was also a son of Sukarama. Raden Samudra.
Pangeran Tumenggung attacked the Bandarmasih. Prince Samudra was assisted by the Kingdom of Demak with the strength of 40,000 soldiers with a fleet of 1,000 boats each carrying 400 soldiers capable of withstanding the attack. Prince Tumenggung was willing to give up the power of the Negara Daha to Raden Samudra. Negara Daha was later merged into the Sultanate of Banjar which held a place in Bandarmasih, while Prince Tumenggung was given an area in Batang Alai.
In 1521, Raden Samudra became the first king of the Sultanate of Banjar with the title Sultan Suriansyah. He also became the first king to convert to Islam, guided by the Islamic cleric Khatib Dayan.