The question how a 5G communication system will look like has been addressed intensely in numerous research projects and in standardization bodies. In the massively connected world of the "Internet of Things" (IoT), it is getting more and more important to be aware of where all these "things" are located. Mobile radio-based technologies envisaged for a 5G system will play an essential role in providing high-accuracy positioning of the "things." In this work, we will first address the fundamental Cramér-Rao lower bound (CRLB) of time of arrival (TOA) estimation in an orthogonal frequency-division multiplexing (OFDM)-based system (such as 4G and 5G) using the pilots. The achievable performance is compared with the 3GPP LTE and potential future 5G requirements. The Ziv-Zakai lower bound (ZZLB) is also considered for TOA estimation, as it is tighter than the CRLB for medium to low signal-to-noise ratios (SNRs). We show how to optimize the waveform in order to reduce the TOA estimation error. Then, we describe some practical low-complexity maximum likelihood (ML) methods for TOA estimation with enhanced first-arriving path detection. Simulation results show that such adaptive ML methods can in some cases (e.g., line of sight) achieve a performance close to the CRLB. Finally, we will briefly discuss cooperation-based positioning, which will become increasingly important for massively connected IoT.