(2 Kings 3) A desperate attempt

“And when the king of Moab saw that the battle was too fierce for him, he took with him seven hundred men who drew swords, to break through to the king of Edom, but they could not. Then he took his eldest son who would have reigned in his place, and offered him  as  a burnt offering upon the wall; and there was great indignation against Israel. So they departed from him and returned to  their own  land.”

What kind of king would offer his own son as a burnt offering in a desperate attempt to appease a pagan god?