1 Kings 1:39
And Zadok the priest took an horn of oil out of the tabernacle, and anointed Solomon. And they blew the trumpet; and all the people said, God save king Solomon. And Zadok the priest took an horn of oil out of the tabernacle, and anointed Solomon. And they blew the trumpet; and all the people said, God save king Solomon.
Zadok the priest took a horn of oil out of the tabernacle and anointed Solomon, and then the trumpet was blown and all the people publicly hailed Solomon as king. This was done as David had ordered, after David confirmed that Solomon should succeed him. It took place in the closing years and near the end of David's reign, when David yielded the throne to Solomon and abdicated in his favor to set him as king in his own place.
The succession was in keeping with God's appointment and direction that Solomon should succeed David. The anointing and public announcement established Solomon as king in David's place and confirmed the change of rule. In this way it defeated Adonijah's rebellion and countered his attempt to seize the throne.
This anointing and proclamation was a beginning full of promise. God intended Solomon to grow in strength and glory, increasingly reflecting the divine character. By so doing he was to inspire Israel to fulfill its sacred trust as keeper of divine truth.