The lyrics are by Isaac Watts. The melody is a slow version of "Lord Bateman" with some modification. It is the same tune to which "Wicked Polly" is usually sung.
There is a different (and modern) tune called "Supplication" in the 1991 edition of The Sacred Harp
It was also printed in Jackson's Spiritual Folk-Songs of Early America (1937).