diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index c8554ae4e65..062ebcfe9ff 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -1052,9 +1052,9 @@ TREEVIEW_InsertItemA(TREEVIEW_INFO *infoPtr, LPARAM lParam)
     switch ((DWORD)insertAfter)
     {
     case (DWORD)TVI_FIRST:
-	TREEVIEW_InsertBefore(newItem, parentItem->firstChild, parentItem);
 	if (infoPtr->firstVisible == parentItem->firstChild)
 	    TREEVIEW_SetFirstVisible(infoPtr, newItem, TRUE);
+	TREEVIEW_InsertBefore(newItem, parentItem->firstChild, parentItem);
 	break;
 
     case (DWORD)TVI_LAST: