Saving Custom Field Values to User Profile I have a custom user field 'myuserfield'

How do I save a value to this field via a plugin in Craft3?

Here is my current attempt.

    $myvar = '12345';
    Craft::$app-&gt;getUser()-&gt;getIdentity()-&gt;setFieldValue('myuserfield', $myvar);
    $myid = Craft::$app-&gt;getUser()-&gt;getIdentity()-&gt;getFieldValue('myuserfield');


When I echo $myid it does, in fact, give me the new value ($myvar or 12345) but when I check the control panel the value is not saved.
I used August's answer, but fixed it:

Put this at the top:

use craft\elements\User;


Then the updating code

$myUser = Craft::$app-&gt;getUser()-&gt;getIdentity();
$myUser-&gt;setFieldValue('fieldHand', 'value');

Craft::$app-&gt;getElements()-&gt;saveElement($myUser, false);