Ahaziah king of Israel/Samaria dies and snubs Elijah (and God); his son, Joram, forms an alliance with Jehoshaphat (of Judah) and defeats Moab. Jehoram (Jehoshaphat’s son) is evil and loses Edom: 2 Kings 1; 2 Kings 3; 1 Kings 22:41−49; 2 Chronicles 20:31−37; 1 Kings 22:50; 2 Chronicles 21:1−4; 2 Kings 8:16−22; 2 Chronicles 21:5−20
Jehoshaphat was regarded as a good king, but he wasn’t too choosy about his alliances. After the battle that killed Ahab, Jehoshaphat had returned to Judah to be confronted by Jehu son of Hanani the seer about allying himself with the wicked (see 2 Chronicles 19:2-3).
2 Chronicles 19:2-3Why should you help the wicked and love those who hate the Lord? … Because of what you have done, the Lord is very angry with you. Even so, there is some good in you, for you have removed the Asherah poles throughout the land, and you have committed yourself to seeking God.
Did Jehoshaphat listen? The evidence suggests that he was pragmatic in his choice of allies, even to the point of financial disaster:
1 Kings 22:48-49Jehoshaphat also built a fleet of trading ships to sail to Ophir for gold. But the ships never set sail, for they met with disaster in their home port of Ezion-geber. At one time Ahaziah son of Ahab had proposed to Jehoshaphat, ‘Let my men sail with your men in the ships.’ But Jehoshaphat refused the request.
There’s slightly more detail in the account in 2 Chronicles:
2 Chronicles 20:35-37 Some time later King Jehoshaphat of Judah made an alliance with King Ahaziah of Israel, who was very wicked. Together they built a fleet of trading ships at the port of Ezion-geber. Then Eliezer son of Dodavahu from Mareshah prophesied against Jehoshaphat. He said, ‘Because you have allied yourself with King Ahaziah, the Lord will destroy your work.’ So the ships met with disaster and never put out to sea.