Long Jaafar is a familiar name to scholars and researchers of the history of this country and of the State of Perak. He was the first to discover tin ore in Perak in 1848 and undertook efforts to develop the tin mining operations. As a result, Perak and the district of Larut in particular, became famous for its tin mines.
To consolidate his position, Long Jaafar had built a fort on a piece of land covering an area of approximately 5 hectares in Bukit Gantang. Within this fortification he built his residence. The fort was constructed using bricks and soil mixed with stone arranged properly and perfectly, appropriate with the height of the fort wall that was built on the hillside. The highest part of the wall stood at more than 2 metres with the lowest at about 1.5 metres high. The construction of the fort took nearly five years to complete.
Within the fort were kept storage containers for tin ore during Long Jaafar's administration. There was also a lake built in front of the fort. Although most of the fort walls have been damaged and destroyed, the fort is still regarded as one of the most important historical remains in Perak.
Long Jaafar died in 1857 and was buried within the fort compounds where his tomb remains to this day. The administration of Larut was later taken over by his son, Ngah Ibrahim. Ngah Ibrahim received his letter of appointment from Sultan Jaafar in 1864 and was bestowed the title of Orang Kaya Menteri. Ngah Ibrahim carried out tin mining activities pioneered by his father. Unlike his father, Ngah Ibrahim did not take up residence in Bukit Gantang. Instead, he built a much larger and sturdier fort and residence in Matang in 1857.
The fort was named Kota Ngah Ibrahim (Ngah Ibrahim's Fort) after his own name and within the fort compound he had his residence built. The fort is square and surrounded by a stone wall of approximately 2.15 metres high. The fort covers an area of about 10,000 square metres. It was built based on Western architectural forms of forts and is similar in form to Kota Kuala Kedah.
Kota Ngah Ibrahim was built near the Larut River in the district of Matang. This was due to the fact that the location was ideal for communication with the outside world, particularly in the transportation of tin ore. On Ngah Ibrahim's success in developing Larut, the Sultan appointed him Minister of Larut, which carried the title Orang Kaya Menteri Seri Paduka Tuan, with full powers over the administration of Larut District. In the beginning, Kota Ngah Ibrahim served as Larut's administrative centre, economic centre, defence and official residence.
Kota Ngah Ibrahim played an important role in the history of Perak, particularly in the beginning of British intervention in Malaya. In 1876, the fort was used as the location for the trial of Perak nationalists and chiefs who murdered J.W.W. Birch, the first British Resident in Perak. Several Malay nationalists who were directly involved in the murder were sentenced to death by hanging. Dato' Sagor, Dato' Mahareja Lela, Si Puntum and Pandak Endut were later hanged in Bandar Baru near Pasir Salak.
Several nobles, including Ngah Ibrahim, were banished to the Seychelles Islands along with Raja Abdullah and their admiral. Ngah Ibrahim's fort and residence were seized by the British. As compensation, the British gave a house to Ngah Ibrahim's first wife, Toh Puan Habibah. Today, the house is used as the official residence of the Territorial Chief.
In 1913, Ngah Ibrahim's residence within the fort compound was converted into the Matang Teachers' Training College, one of the oldest colleges in the Malaya. However, the college was closed down in 1922 when the Sultan Idris Teachers' Training College opened in Tanjung Malim. Consequently the building served as the Matang Malay School and headquarters of the Japanese Army during World War 2 (1941-1945). After the war, the building served as a Malay School until 1985 when it was handed over to the museum for preservation.
At that point in time, Kota Ngah Ibrahim remained intact and its square design unchanged. Some parts of Ngah Ibrahim's residence within the fort were converted into classrooms to meet the needs of the nearby Sekolah Kebangsaan Matang.
Aside from Ngah Ibrahim's fort and residence, Matang has an oral history of a mosque known as the Tengku Menteri Mosque. The mosque is believed to have been built by Ngah Ibrahim at the time of construction of the fort around 1868. It was named the Tengku Menteri Mosque after Ngah Ibrahim's title as the Minister of Larut. Today, the mosque is known as the Matang Mosque, and is still being used by the village community.