Excavations in 1934 and 1962 revealed the foundations of an earlier stone church beneath the present floor, dated to around 1200, and a fragment of a rune-carved grave chest suggesting that a burial ground and timber (stave) church may have stood here as early as the 11th century. Of that medieval stone church, only the tower survives; the chancel was rebuilt around 1600, and further additions followed over the centuries.
Accounts state that the church was burned by Danish forces in 1566, with repairs carried out a few years later; a detached bell tower was added in 1567. A stone porch and a burial chapel for Commander Johan Alexander Götherhielm (1688–1764) were later built to the south.
The most significant transformation came in 1776, when most of the older building was demolished, leaving only the tower and part of the north wall. The church that emerged that year gave Viby kyrka the form and proportions it retains today. Restorations in 1934 and 1962 recovered the Gustavian character of the interior, which is dominated by Pehr Hörberg's altarpiece, painted in 1796.
Among the furnishings, a limestone font from 1659 stands in the chancel, thought to have been made by Michael Hacke of Skänninge. An 18th-century floor clock by Pehr Larsson is a reminder that this district was once a notable centre of folk clockmaking. The church has also had several organs over the years, including instruments dating from the 1780s and later rebuilds, along with a small organ for use in the choir.
In the churchyard stand three rune stones, one of which was uncovered during the 1962 restoration and dated to the late 900s; its inscription commemorates a young man named Gemar, raised by his father. The other two stones bear only fragmentary inscriptions, and a further stone nearby is decoratively carved but bears no runes at all.