Bring a large pot of salted water to a boil. Add potatoes and cook until tender but still firm, about 15 minutes. Drain and mash.
In a large mixing bowl combine mashed potatoes, cream cheese, onion, eggs, flour, salt and pepper. Using an electric mixer, beat on medium speed for several minutes. Spoon mixture into a 1 1/2 quart casserole dish and top with crushed fried onions.