Thanks for the quick reply.
The printer is a HP Photosmart 5510 B111 series. I'm running the latest version of Windows 10 on a Dell desktop.
The HP Print and Scan Doctor tool was not able to see the printer even if I supply the IP address. On the other hand, I can connect to the Printer from the PC by typing the printer's IP address in a browser and can also ping the printer from the PC.
The printer seems OK in the control panel (Printers & Scanners) and it's hardware properties don't show anything wrong. However, the printer does not show up in the Device Manager (since I can't seem to install it using the HP installation program, which does not see the printer).
The Microsoft Scan app does not see the scanner either.
I have tried stopping the firewall and other programs that may block LAN requests but nothing seems to help.