Physical unclonable functions (PUFs) generate secret keys that are unique and derived from the manufacturing process variations of the device. For high-security applications, generating the keys on the device is more secure than storing it on the device due to its resistance to attacks like tampering, probing and side-channel attacks. Also, the PUF-key generated should be very unique and reliable. In this paper, we are proposing a novel technique of generating a Ring Oscillator (RO) based PUFkeys on FPGAs by K-means clustering of RO frequencies. The placement of ROs on the FPGA fabric will have an impact on the variation of their oscillating frequencies. Based on the similarities in their frequency variations, the RO frequencies are grouped into k-clusters by K-means clustering and, the comparison of within-cluster RO frequencies will generate the PUF-keys. Our proposed method is evaluated on a large population of 193 Xilinx Spartan FPGAs. With the proposed method, the average interdie Hamming Weight of the PUF responses is 48.92% which is close to the ideal value of 50%, the average Hamming Weight of the n-bit PUF response is 49.90% and the average error rate due to changes in temperature and voltage is 3.43%.