The village was part of the Székely Land region of the historical Transylvania province. It was first mentioned in 1600 as Gijmes. The area of the commune belonged to Csíkszék until the administrative reform of Transylvania in 1876, when it fell within the Csík County of the Kingdom of Hungary. The village was occupied by the Romanian army between 13 and 20 November 1918. Shortly thereafter, the Union of Transylvania with Romania was proclaimed, and the village, like the rest of Transylvania, formally passed with the Treaty of Trianon from Hungarian to Romanian control in 1920. In 1940, the Second Vienna Award granted Northern Transylvania to Hungary and the village was held by Hungary until the end of World War II until the Soviet occupation, whereafter the Romanian administration returned and the commune's status as part of Romania was formalized in 1947. Until 1920, it was a border village between Hungary and Romania and as such, it had an important and large railway station designed by Hungarian architect Ferenc Pfaff. The main building of the station was 102m long and 13m wide, comparable in size and elegance with the railway stations of Szeged and Fiume. In 1950, as part of a wider administrative reform, the commune was transferred from Ciuc County to Regiunea Bacău. School education in the Hungarian language was abolished in 1965. Local teacher and school director András Deáky advocated for teaching in Hungarian and re-organized it after 1990. He also established a Hungarian language library from donations of the public.
Demography
In 2011, it had a population of 5,094; out of them, 2578 were Hungarian, 2282 were Romanian, 101 were Roma and 48 were Ceangăi. 59% had Hungarian as first language, and 39% Romanian. As to religion, 59% of the commune population are Roman Catholic, while 39% of them belong to the Romanian Orthodox Church.
Landmarks
On the right side of the Ghimeș Pass, on the pre-World War I Hungarian-Romanian border, the ruins of the Rákóczi Castle can be seen. It was built in 1626 upon the order prince Gabriel Bethlen. Later, it was strengthened several times, but today, it is in ruins.
The old Roman Catholic church was built in 1782, its registers are kept as from 1785.
The new Roman Catholic church was built in 1976, thanks to the efforts of parish priest Gergely Dani, it is decorated with frescoes made by Magda Lukásovics.