At a great cost; "he paid dearly for the food"; "this cost him dear".
With affection; "she loved him dearly"; "he treats her affectionately".