We investigate the properties of a weighted analogue of Ripley's K-function which was first introduced by Baddeley, Møller, and Waagepetersen. This statistic, called the weighted or inhomogeneous K-function, is useful for assessing the fit of point process models. The advantage of this measure of goodnessof-fit is that it can be used in situations where the null hypothesis is not a stationary Poisson model. We note a correspondence between the weighted Kfunction and thinned residuals, and derive the asymptotic distribution of the weighted K-function for a spatial inhomogeneous Poisson process. We then present an application of the use of the weighted K-function to assess the goodness-of-fit of a class of point process models for the spatial distribution of earthquakes in Southern California.