Frederick II was King in Prussia from 1740 until 1772, and King of Prussia from 1772 until his death in 1786.